Hello! When saving the image

Image1.Picture.SaveToFile(Edit1.Text+inttostr(i) +Edit2.Text); 

In this way, the question arose: how to control the volume of the image? I need to have an image of fun no more than 65 KB. How can this be implemented?

  • 2
    multiply the width by the height and the depth of color, plus the length of the header and palette. - Nofate
  • I need this to not change the size of the image. - nanamit
  • Do you want a picture of any size after saving to be no more than 65Kb? It does not happen. - Nofate
  • It seems that EFG had a study on the dependence of the size of a JPEG file on the compression ratio ... - karmadro4

1 answer 1

Change the depth of the palette, sv-in PixelFormat . The default is pf32Bit , you can install it in pf24Bit without loss of quality, pf15Bit also gives a good result. Well, if this is not enough, then make your own algorithm for reducing the number of colors in the palette. Fewer colors - smaller size.