Jpg - How? I recomend using Jpg when you really need to squeez a file. Let's save the picture as a jpg. Assuming you are using GIMP, Go to the save as screen and type MyFile.jpg to save it as a jpg. If it has more then 1 layer or a layer mask you might get an export screen. Click Export. Now you should see this screen:
Check the box that says "Show preview in image window" to see a preview with the final quality. I got this:
As you can see, there is some loss of quality. So let's increase the quality to 100:
This is nice, but a close look would reveal that there is some loss of quality - take a close look on the black line of the letter F, and compare it with the source. If you still need more quality, it's possible:
I clicked the '+' sign next to the advance options, and changed the subsampling to 1X1 1X1 1X1 (best quality). Now, it's almost impossible to find and loss of quality - this is good! Jpg Tips and Tricks:
- In order to reduce filesize, notice that the quality increases the filesize logerithmically. This means that decreasing the quality from 100 to 99 will decrease the filesize much more then decreasing the quality from 90 to 89. I usually try to save the Jpg on quality of 97.
- Changing the subsampling to 1X1 and reducing the quality, can sometimes give better results then the default subsampling (smallest file) with higher quality. Play with the subsampling and quality untill you find the best ratio between quality and filesize.
- Jpeg doesn't support indexed images - convert them to RGB or Grayscale before saving (Image->mode->RGB/Grayscale)
If your image has transparency in it, choose Merge Visible Layers, in order to merge all the layers to one layer while keeping the transparency (it won't affect the opened image, it will only tell the plugin how to work with the image). You should then see this screen:
I strongly recomend to uncheck the checkbox next to Save color values from transparent pixels. If it's checked, the color of all 100% transparent pixels will be saved - this is usually a waste of memory as it's probably not necessary (unless you hid a watermark or anything else on transparent pixels). Unchecking this checkbox will save you lots of memory. PNG - No Transparency If your image shouldn't have any transparency, you should flatten it. Flattening merges all the layers and causes all transparency to be replaced by the background color, it causes the removal of the alpha (transparency) channel. The PNG plugin will save the transparency channel even if everything is 100% opaque (o% transparent). However, if the image is flattened, it won't save the alpha channel. To flatten your image, First save a backup with all the layers (save it as an .xcf/.psd or whatever filtype your program uses), Then go to Image->Flatten Image (Click). Notice that all hidden layers in your image will disappear, and all the visible ones will be mreged. The name of this layer will become bold to mark that it has no alpha channel. Now, let's get back to the export window:
Choosing flatten image will do the flatening as described above on a temporary copy in your computer's memory. It will save a flattened image and will keep your current copy untouched. Now, the same screen should pop but with the save color values from transparent pixels should be grayed out.
PNG Tips and Tricks
-
If your image has only one layer, you won't see the export screen where you can choose to flatten your image or to merge the visible layers. You will need to flatten it manually (image->Flatten) if you want it flattened.
-
If your image doesn't have to many colors (like the screenshots of the windows above), save them as PNG. It saves lots of memory and has no loss of quality.
-
PNG transparency won't be displayed in Internet Explorer - instead you will see some bright blue background, so take that into consideration if you use it in a webpage. Here is a neat way to fix this bug.
-
Finally and most important, In order to squeeze a PNG file, simply reduce the colors! Image->Mode->Indexed (Click). Choose the amount of colors you want (up to 256). When converting to an indexed image, you can control the dithering - it's in the bottom of the window that will pop when you choose "indexed". If your PNG file has many similar colors you might want to index it and by this saving lots of disk space. Note: This technique will probably reduce the quality of the image. You shouldn't try it on an image with lots of different colors (Click to see why)
-
Is your image grayscale? If so convert it to grayscale mode (Image->Mode->Grayscale) to reduce the filesize.
That's it - I hope you enjoyed the tutorial and that you learned a bit. Feel free to leave a comment below with Questions/Thoughts/Opinions. If you have any comment about the site, also feel free to comment.
Nice tutorial. I got some small suggestions.
ReplyDeleteThere is a very handy plug-in for Gimp called 'Save for web' to make saving images easier. http://registry.gimp.org/node/33
After creating a .png image I suggest using PNGCrush to make the file size, most of the time, even a bit smaller. The program PNGGauntlet has PNGCrush build in and works good to compress more images at once.
http://brh.numbera.com/software/pnggauntlet/
Hi,
ReplyDeleteyour tutorials are very nice!
Please stay blogging!
Alan