![]() To know whether such a solution is reasonable, we have to know the true numbers of your problem.Īlso, if you are really going to throw away the information permanently, you are almost certainly better off using JPEG compression, which is designed to lose information reasonably gracefully. (The examples are netpbm/ pbmplus, which I have always found easier to understand than ImageMagick.) If that's not enough you can toss a ppmquant in the middle (on the small image) to reduce the number of colors. pngtopng big.png | pnmscale -reduce 6 | pnmscale 6 | pnmtopng > big.png If you get unlucky the savings will be more like 6. If you get lucky, you'll reduce image size by a factor of 36. Meanwhile, the "cheap and cheerful" approach I would try would be as follows: scale the image down by a factor of 6, then scale it back up by a factor of 6, then run it through PNG compression. Your example is troublesome because a 30MB image at 800圆00 resolution is storing 500 bits per pixel. Just keep playing with the quality value until you get a suitable output. Worried about privacy Images never leave your device since Squoosh does all the work locally. Feeling adventurous Adjust the settings for even smaller files. Open your image, inspect the differences, then save instantly. From the docs: $magick> convert input.png -quality 75 output.jpg Squoosh can reduce file size and maintain high quality. Read through the docs, and start experimenting!ĮDIT: Looks like it should, indeed, be pretty easy with ImageMagick. Again, the quality / size of the output will depend on the type of image.įinally, while I have not used ImageMagick in a little while, I'm almost certain there are options to re-compress an image using a specific quality factor. If not, JPEG almost certainly could- JPEG compression ratios on the order of 10:1 are not uncommon. Depending on the type of image, the PNG compression may very well provide that level of compression. XnConvert allows you to easily and quickly reduce the picture size or resolution before to send emails, or to share on social media like Instagram. Therefore, you only need a 1.4:1 compression ratio to get the image down to 1MB. (I would be very surprised to see a 30MB file at those smallish dimensions.) In fact, even uncompressed, the image would only be around 1.4MB: 800 pixels * 600 pixels * 3 Bytes / color = 1,440,000 Bytes = 1.4MB However, at 800圆00, it likely will be very easy to get a JPEG down under 1MB. (PNG, on the other hand, has the opposite behavior- it's best for logos, etc.) It does not do as well for logos, screen shots, or other images with "sharp" transitions from light to dark. JPEG does best for "true life" images, such as pictures from cameras. ![]() Obviously, depending on the image, the loss of visual quality may be substantial. All of this can be done without changing the image resolution. JPEG has a settable "quality" factor- you could simply keep reducing the quality factor until you got an image that was small enough. PNG is not a lossy image format, so you would likely need to convert the image into another format- most likely JPEG. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |