Incorrect colors when saving an Image

Posted by Alex

I am having trouble with keeping correct colors when saving an Image..

It saves OK using

image1.picture.bitmap.savetofile(savepicturedialog1.filename);
-----------------------------------------
or even assigning it to a bitmap before saving..

procedure TForm1.save_pictureClick(Sender: TObject);
var
bitmap: Tbitmap;
begin
bitmap := Tbitmap.Create;
if SavePictureDialog1.execute then
begin
try
with bitmap do
begin
Assign(Image1.Picture.Bitmap);
SaveToFile(SavePictureDialog1.filename);
end;
finally
bitmap.Free;
end;
end;
end;
----------------------------
BUT the colors are all wrong when viewed in a graphics program...

I have tried viewing with micrografix picture publisher and Photoimpact 5 ..

And if i look at the picture properties is see that the color model is 32bit CMYK color rather than RGB color...

But it views correctly if I load it into the windows standard Paint program..

I really don't understand why delphi does not save it as RGB color ??
I am a bit of a novice at many aspects of programming..

If I load a picture into a bitmap and then transfer it to an Image and save the image then the colors are correct. because it is 24bit RGB color and maintains the color of the original picture loaded.

How can i simply save an Image.canvas.bitmap to a file and have it as RGB ??

If i save as a jpeg then it is ok.. but i want full fidelity..

Any help appreciated to reduce hair loss... :)

Cheeeerrrrrrsssssssss Alex.

Related articles

       

Follow Ups