I'm working on a website where users can upload images. To ensure fast loading times on the image overview page, the application automatically creates a thumbnail of every image that is uploaded to the site.

Right now, I have it set so it will always create the thumbnail in the JPG format, mostly to make the files smaller. However, that approach has at least one drawback: JPG doesn't support transparency, so when a user uploads a PNG file that makes use of transparency, the thumbnail might look weird and the user might not be able to find the image in the gallery at a glance.

That led me to this question: why not just use the same format for the thumbnail as the original image? That way I can make sure that the thumbnail looks pretty much like the image the user uploaded. (Thinking about it, it could even support animated GIFs, though I'm not sure if that's a good idea). The downside of that approach would be that the file size might be higher, resulting in a worse user experience with the site.

As I'm writing this question, I'm beginning to feel like the second approach would be the one to prefer, but I'd still like to ask some other webmasters for input. What other technical reasons are there for using the same format for the thumbnail as the original image, or for simply using a fixed image format for all thumbnails?

  • This question can be closed for asking for a recommendation or opinion when in fact, it is a dang good question. Can you rewrite the last sentence (still as a question is fine) asking for technical information for each or any other format that would serve your purpose?
    – closetnoc
    Jun 28, 2015 at 22:02
  • Done. Thanks for the hint, this way it's actually more clear what I'm asking.
    – Jerry
    Jun 28, 2015 at 22:07
  • Thanks!! I hate to see good questions be put on hold for something so simple. I use PNG for size and am converting any JPG to PNG. But I am not doing what you are doing so I am not sure how to give you a good answer. However, I know there are at least couple of regulars (if not more) here that are experts on just this topic.
    – closetnoc
    Jun 28, 2015 at 22:18

1 Answer 1


Use the same format for thumbnail. The absolute difference between a resized jpg and a resized png/gif is too little to matter anyway, even thoug the percentual difference may still seem big. You may need to account for numbers as well, though. How many such png/gif thumbnails are you going to display on a single page at any time? If there are tens or hundreds, the overhead will add up and you need to make a tough decision. But if you have just a few tens of Kb extra, translated into something like less then 10%, the there's not much worry.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.