kjerstih
asked on
Thumbnail images turning strange colors
I created thumbnails and large jpgs in PS that I uploaded for a php gallery script. The large images look fine on the site, but the thumbnails look like they have a severely limited color pallette with very low quality. See the offending images at :
http://www.bojodesigns.com/gallery/index.php?cid=1
If you click on a thumbnail you can see what I mean. I've tried resaving all of the thumbs with a higher jpg quality but that didn't help. I'm not doing and photo resizing in my script...
Does anyone have experience with this problem?? TIA
http://www.bojodesigns.com/gallery/index.php?cid=1
If you click on a thumbnail you can see what I mean. I've tried resaving all of the thumbs with a higher jpg quality but that didn't help. I'm not doing and photo resizing in my script...
Does anyone have experience with this problem?? TIA
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I has to be color modes. Perhaps it was changed to something other than CMYK, RGB, etc?
We need to know where the thumbnails are being made. In photoshop? In PHP?
It sounds like you're making them in Photoshop. If so, how are you resizing/saving them? While you resize and save, do you see the color problem? If you reopen the file, does it happen then? Is it only when you upload and view in a browser?
If you resize in PHP, what script is doing the resizing?
I had trouble with color problems when resizing in PHP, turned out I wasn't using true-color images before resizing (so they were pallette-ized by default).
It sounds like you're making them in Photoshop. If so, how are you resizing/saving them? While you resize and save, do you see the color problem? If you reopen the file, does it happen then? Is it only when you upload and view in a browser?
If you resize in PHP, what script is doing the resizing?
I had trouble with color problems when resizing in PHP, turned out I wasn't using true-color images before resizing (so they were pallette-ized by default).
I used MGI Photosuite 4 to resize the picture and they look almost as good as the full size, one you can also download is IrfanView it's a free software but it give you quite a bit of control (shift-G) will let you adjust gamma correction, brigthness, contrast, saturation as well as color balance.
http://www.irfanview.com/
Gamebits
http://www.irfanview.com/
Gamebits
ASKER
Hi all,
Thanks for the comments. To address some of the questions….I made both the large and the thumbnail images in PS CS2 and both look fine when reopened in PS. Both sets of images are in the AdobeRGB(1998) color profile. I resized the large images down in PS and then did a “Save for web” with the jpeg, high quality settings. I’m not doing any resizing in PHP (no GD issues)…but for giggles, here’s the code that deals with grabbing my thumbnails from a directory and outputting them:
// Thumbnail Listing
else if( $cid && empty( $pid ) )
{
$number_of_thumbs_in_row = 3;
$result = mysql_query( "SELECT photo_id,photo_caption,pho to_filenam e FROM gallery_photos WHERE photo_category='".addslash es($cid)." '" );
$nr = mysql_num_rows( $result );
if( empty( $nr ) )
{
$result_final = "\t<tr><td>No Category found</td></tr>\n";
}
else
{
while( $row = mysql_fetch_array( $result ) )
{
$result_array[] = "<a href='http://www.bojodesigns.com/gallery/index.php?cid=$cid&pid=".$row[0]."'><img src='".$images_dir."/tb_". $row[2]."' border='0' alt='".$row[1]."' /></a>";
}
mysql_free_result( $result );
$result_final = "<tr>\n";
foreach($result_array as $thumbnail_link)
{
if($counter == $number_of_thumbs_in_row)
{
$counter = 1;
$result_final .= "\n</tr>\n<tr>\n";
}
else
$counter++;
$result_final .= "\t<td>".$thumbnail_link." </td>\n";
}
if($counter)
{
if($number_of_photos_in_ro w-$counter )
$result_final .= "\t<td colspan='".($number_of_pho tos_in_row -$counter) ."'> </td>\n";
$result_final .= "</tr>";
}
}
}
//end code
Thanks again for your assistance.
Thanks for the comments. To address some of the questions….I made both the large and the thumbnail images in PS CS2 and both look fine when reopened in PS. Both sets of images are in the AdobeRGB(1998) color profile. I resized the large images down in PS and then did a “Save for web” with the jpeg, high quality settings. I’m not doing any resizing in PHP (no GD issues)…but for giggles, here’s the code that deals with grabbing my thumbnails from a directory and outputting them:
// Thumbnail Listing
else if( $cid && empty( $pid ) )
{
$number_of_thumbs_in_row = 3;
$result = mysql_query( "SELECT photo_id,photo_caption,pho
$nr = mysql_num_rows( $result );
if( empty( $nr ) )
{
$result_final = "\t<tr><td>No Category found</td></tr>\n";
}
else
{
while( $row = mysql_fetch_array( $result ) )
{
$result_array[] = "<a href='http://www.bojodesigns.com/gallery/index.php?cid=$cid&pid=".$row[0]."'><img src='".$images_dir."/tb_".
}
mysql_free_result( $result );
$result_final = "<tr>\n";
foreach($result_array as $thumbnail_link)
{
if($counter == $number_of_thumbs_in_row)
{
$counter = 1;
$result_final .= "\n</tr>\n<tr>\n";
}
else
$counter++;
$result_final .= "\t<td>".$thumbnail_link."
}
if($counter)
{
if($number_of_photos_in_ro
$result_final .= "\t<td colspan='".($number_of_pho
$result_final .= "</tr>";
}
}
}
//end code
Thanks again for your assistance.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
jsev1995,
I'm a little confused about what you mean by not degrading the quality. A "high" jpeg setting under the save for web option is usually overkill when it comes to image quality for the web. I have routinely used the "medium" setting over the years without these weird effects. Is it possible something else is going on? Thank you for creating these thumbnails..they definitely are what I'm shooting for...but don't really solve my problem. I'm going to have much more than these 5 thumbnails so I need to be able to do it myself.
I'm a little confused about what you mean by not degrading the quality. A "high" jpeg setting under the save for web option is usually overkill when it comes to image quality for the web. I have routinely used the "medium" setting over the years without these weird effects. Is it possible something else is going on? Thank you for creating these thumbnails..they definitely are what I'm shooting for...but don't really solve my problem. I'm going to have much more than these 5 thumbnails so I need to be able to do it myself.
I'm sorry, I misread/mixed up something. Try these instructions, nothing more, to make your thumbnails, and see if it works:
1. Open large image in photoshop
2. Go to image->resize->Image Size
3. Set the size and click OK
4. File->save
If this works for you, you clicked some other setting last time and that caused the problem. If not, it is some kind of bug in Photoshop and should be reported to Adobe Support.
What version of Photoshop are you using?
1. Open large image in photoshop
2. Go to image->resize->Image Size
3. Set the size and click OK
4. File->save
If this works for you, you clicked some other setting last time and that caused the problem. If not, it is some kind of bug in Photoshop and should be reported to Adobe Support.
What version of Photoshop are you using?
ASKER
I'm using PS CS2. I will try the regular save (versus the save for web I've been using) later today. Though even if it works, I would be curious to know why this time "save for web" didn't work....why even have the web optimization choice in PS?! I'll let you know how it works...Thanks.
Does "Save for Web..." let you choose a colour profile? If so, make sure it's sRGB and not Adobe RGB.
ASKER
PS doesn't let you pick in the save window, but I will try that as well as the regular save option....thanks for the reminder about sRGB, I vaguely recall that can cause some problems every once in awhile.
so did my suggestion work?
ASKER
Mea Culpa everyone! I forgot that I have a file upload scriptthat has one line for resizing in PHP...I was only looking at my main gallery script before! Once I manually inserted records into my db without using the upload script, all was well. So that was the problem. My sincerest apologies and thanks to all that made suggestions. I would like to split my points between jsev1996 and HackneyCab for their efforts...