Create PNG thumbs instead of JPEG thumbs Create PNG thumbs instead of JPEG thumbs
 

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Main Menu

Create PNG thumbs instead of JPEG thumbs

Started by chsp1980, September 07, 2004, 11:15:33 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

chsp1980

Hi,

I have a problem with my thumbnails automatically created by CPG. These are JPEG files which do not look great. In my old - handmade ;-) - photo gallery I used to create PNG (or GIF, or some other lossless file format) thumbs which look a lot better. As I read in the manual, the GD lib is capable of working with PNG files. But how do I tell CPG to create these PNG files?

Thanks for your support.

Regards
Christoph


Joachim Müller

please post a link to your page so we can have a look. Usually, the jpeg thumbs have a quailty that is good enough for web use when you have either GD2 or ImageMagick - bad thumbnail quality usually is a result of usage of GD1 (which has only a reduced color depth, no matter what file format you use).

Joachim

chsp1980

Hi Joachim,

I suggest it was my mistake ;-). I changed the width of the thumbs which are displayed on the album overview but didn't know that these pics are nothing but browser-scaled thumbs from the gallery. After setting both values for the thumbnail size to an equal value, it looks a lot better. But the quality of the JPEGs is not as well as the quality of PNG or GIF thumbnails (although GIF has the color palette reduced to 256). Also, the file size of the JPEG files is two to three times larger than the one of comparable PNG files (120px width: PNG 4..5 KB, JPEG 15..20 KB).

If you want to have a look at my gallery, click here.

Thank you for your support!

Chris

Joachim Müller

What quality did you set the jpegs to have? 17kB is way too much for a thumbnail of this size...
You have to understand that gif and png are lossless formats, while jpeg compression goes together with quality loss. Please post what method for image resizing you use (GD or ImageMagick).

Joachim

chsp1980

JPEG qualitiy is set to default (80). I tried to create thumbnails with GD2 and then with IM. Both look the same. If I create thumbnails manually, e. g. with XnView, they seem to be a lot sharper, although the file size is up to three times smaller.
Here's an example for this: compare this one (created manually) to that one (created by CPG).
Are there further parameters for IM 'convert' to achieve a better quality? If I increase JPEG quality, files will become larger again.
I know that JPEG is a lossy file format, but that's why I wonder that JPEG thumbnails are larger than PNG ones - and not looking better.

Chris


Joachim Müller

GD and IM are server libraries - you can hardly expect similar results to sophisticated desktops apps, sorry...
I just don't know what to recommend.

Joachim

chsp1980

OK, you're right.
But what about the heavy file size?

Joachim Müller

I just don't know -  did you make coppermine generate the thumbnails after you set up the compression and such stuff in copermine config or before? The reason I'm asking is: you have to understand that changes in coppermine config for resize settings are only being taken into account for pics that are added to coppermine from that time on when you set the new configuration, the pics that existed in your database before will remain unchanged. You can try to re-apply the settings by re-creating the thumbs and intermediates, using the resize utility from the admin tools in coppermine's admin menu.

I have never come across this behaviour before - if you have set up everything right, take a look into your pics before upload, using your favorite desktop app: do they have "unusual" properties like abnormal color settings (both GD and IM only work well if you're using RGB)? Make sure you have set resolution to 72 or 96 dpi (which is the max for display of images on monitors, only printers will use higher resolutions.

Joachim

chsp1980

Of course I generated the thumbs after making my settings...
The pics are straight from a camera, of course they have RGB palette. And of course they have an adequate resolution.
But I understood that this is a problem of GD / IM and I won't bother you any more...

Chris