I am evaluating the gdPicture 9 components (looking forward to 10 with improved ICC Color profile support), and noticed this issue:
It looks like when an image with an ICC profile is loaded and resized, something strange is happening with the color. For example, look at this Delphi code which loads a JPG, save it right back, then reduces it 1 pixel and saves it again:
Code: Select all
procedure TForm1.Button1Click(Sender: TObject);
var
gdPicImg: TGdPictureImaging;
ImageID: integer;
NewWidth, NewHeight: integer;
begin
gdPicImg := TGdPictureImaging.Create( nil );
ImageID := gdPicImg.CreateGdPictureImageFromFileICM( 'D:\Tmp\ColorTestProfile.jpg' );
gdPicImg.SaveAsJPEG( ImageID, 'D:\Tmp\ColorTestProfile_Full.jpg');
NewWidth := gdPicImg.GetWidth( ImageID )-1;
NewHeight := gdPicImg.GetHeight( ImageID )-1;
gdPicImg.Resize( ImageID, NewWidth, NewHeight, InterpolationMode_HighQualityBicubic );
gdPicImg.SaveAsJPEG( ImageID, 'D:\Tmp\ColorTestProfile_AlmostFull.jpg');
gdPicImg.ReleaseGdPictureImage( ImageID );
end;
This particular image is close, but you see the differences mostly in the reds (like the robot and chart). Some images better demonstrate this difference, but I can't paste those as they are not public domain images.
How can I get the colors to remain consistent under these conditions?
Note that the source image came from http://www.scienceandart.org/photoshop2 ... tA4Ltr.jpg