Hello Nigel,
Please put following code in button click event:
var
ieMain, ieTemp1: TImageEnView;
Desc1, Desc2: string;
LayerW, LayerH: Integer;
begin
Screen.Cursor := crHourGlass;
ieMain := TImageEnView.Create(nil);
ieMain.LegacyBitmap := False;
IEGlobalSettings().EnableCMS := True;
IEGlobalSettings().ApplyColorProfileOnRendering := True;
ieMain.IO.NativePixelFormat := True;
ieMain.IO.Params.PSD_LoadLayers := True;
ieMain.IO.Params.PSD_ReplaceLayers := True;
ieMain.IO.Params.JPEG_EnableAdjustOrientation := True;
ieMain.IO.LoadFromFilePSD
('Double01Y.dat'); //This PSD file is 32bit image with layers
// Remove Layer with Arrow symbols and Text Layers
ieMain.LayersRemove(10);
ieMain.LayersRemove(9);
ieMain.LayersRemove(3);
ieMain.LayersRemove(2);
ieMain.LayersCurrent := 1;
LayerW := ieMain.CurrentLayer.Width;
LayerH := ieMain.CurrentLayer.Height;
//Load the JPG files with different resolution and color space and profile
ieMain.IO.LoadFromFileJpeg('0000_1.jpg');
ieMain.CurrentLayer.Width := LayerW;
ieMain.CurrentLayer.Height := LayerH;
ieMain.LayersCurrent := 6;
LayerW := ieMain.CurrentLayer.Width;
LayerH := ieMain.CurrentLayer.Height;
ieMain.IO.LoadFromFileJpeg('0001_1.jpg');
ieMain.CurrentLayer.Width := LayerW;
ieMain.CurrentLayer.Height := LayerH;
ieMain.LayersMergeAll();
ieMain.IO.Params.JPEG_Quality := 90;
ieMain.IO.Params.JPEG_ColorSpace := ioJPEG_CMYK;
ieMain.IEBitmap.ColorProfile.Assign_CMYKProfile();
ieMain.IO.SaveToFileJpeg('Test001.jpg');
ieMain.Free;
Screen.Cursor := crDefault;
For the other files please download from my second post.
Please use attached sample image files.
attach/yogiyang/201712815932_SampleImages.zip
4770.49 KB
Note: The .psd file is of 300 DPI and its profile and color space are set for CMYK
The file 0000_1.jpg is a 24 bit image with 72 dpi resolution and the file 0001_1.jpg is a 24 bit image with 200 dpi resolution.
The output file that you will get from above code will come be in 200 dpi resolution. In spite of the fact that the psd file is of 300 dpi.
The file when opened in Photoshop will result in Photoshop showing Profile error message as stated in my first post.
TIA
Yogi Yang