Can I use convert to upsample images to a specific filesize?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony »

From IM Examples on JPEG images, write settings
http://www.cit.gu.edu.au/~anthony/graph ... #jpg_write
NOTE: You can not determine a quality to get a specific filesize, except by trying it. The best way is to say try (a quality of) 75% and see the result if to large reduce by 10%, if two small increase. Then do a binary search to find the quality that best matches what file size you want. Shouldn't take more than 5 to 6 trys to figure it out.


Of course you did not specify JPEG, though that is probably the most common for general images. But we can't help you much further without knowning what format you are using.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply