fchan

discussion

PNG thumbnails. Anyone else notice this?

Pages:1
1Report
Cloudchaser Shaconage at 31 May 2006: 01:38

Hello :-)

I just noticed that many png thumbnails are about twice as large as the full size images.  Take this thread for example.

http://fchan.hentaiplanet.net/crit/res/1236.html

All except three thumbnails are about twice as large as the full size images.  Of the remaining three, the fourth down from the top is 20K smaller than the full size but is still big in filesize for a thumbnail and the 1st 'n' 3rd thumbnails are just under 4 times the size of the full size images.  There is no difference in image quality between thumbnail and full size.  On any site, most of if not the only purpose of thumbnails is to reduce page loading time, but that can't happen if the thumbnails have a larger filesize than the full size images.  Why is Fchan's thumbnail creator doing that to png's?

2Report
at 31 May 2006: 02:42

That's just the way things are with the thumb libraries in php or perl when they come across a PNG.

PNG's are lossless and when you make a thumb, it "fuzzez" it and that adds a LOT of information.

3Report
Min at 31 May 2006: 18:57

To be more accurate, in this case, it's because the number of colors in the picture is being increased.  For example, in the first image, the total number of colors in the picture is 24; in the second, the total number is 7,824.  This is because fchan's thumbnail-making software probably performs some sort of resampling filter on the image (maybe bicubic?) when resizing it; this causes the downsized image to look much better than if it were created through a purely linear resize.  The larger color palette makes it much harder to compress the image, however.  (technically, though, the original still has much more information in it than the thumbnail; the raw image takes up about 3x as much space in memory)

The reason this is so much more noticable with a lossless format than with a lossy format is because lossy formats already discard large amounts of information.  For example, converting the first image to JPEG causes it to take up about 50 kB in size as opposed to the original 13 kB.  A JPEG thumbnail is only 20 kB; still larger than the original PNG, but smaller than the PNG thumbnail.  Why did the original get so much larger?  That's because sharp transitions between colors are easy to represent in the positional domain, but they are much more difficult to represent in the frequency domain (which is what JPEG does).  The JPEG thumbnail is smaller than the original JPEG because the original had already lost much of the original's information.

Clear as mud, now?

The short answer is: that's just the way that lossless images with sharp transitions between pixels work.  Making the thumbnail smaller than the original would also make the thumbnail much uglier.

4Add Reply
Name Sage? - captcha =
First Page - Last 40 - Entire Thread

Powered by: Shiichan Version 3956
The contents of this page are asserted to be in the public domain by the posters.
The administrators claim no responsibility for thread content.
Manage