ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Image getting saved in Grayscale Why?

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
yogiyang Posted - Jul 12 2016 : 11:27:40
Hello,

I am using following code to Load images in TImageEnVect on different layers and then merging them all and saving the image as JPG. Here is the code:

// Create a New Doc
ImageEnVect.Blank;
ImageEnVect.ClearAll;
ImageEnVect.Proc.Clear;
ImageEnVect.RemoveAllObjects;

ievMain.Proc.ImageResize(2400, 1200, iehLeft, ievTop);
ImageEnVect.Proc.Fill(clWhite);
ImageEnVect.IO.Params.Dpi := 100;
ImageEnVect.ChangeResolution(100, rfBicubic);
ImageEnVect.Layers[0].Locked := True;
ImageEnVect.Layers[0].Selectable := False;
ImageEnVect.Update;

//Code to Load Images on Layers
FileName := 'F001.jpg';
//Load image in a Temp instance
ieTemp := TImageEnView.Create(Application);
ieTemp.IO.Params.JPEG_EnableAdjustOrientation := True;
ieTemp.LayersAdd;
ieTemp.IO.LoadFromFile('001.jpg');

ieTemp.Proc.Resample(-1, 800, TResampleFilter(4))

LayerCurr := ImageEnVect.LayersAdd;
ImageEnVect.Layers[LayerCurr].Assign(ieTemp.CurrentLayer);
ImageEnVect.Layers[LayerCurr].PosX := 0;
ImageEnVect.Layers[LayerCurr].PosY := 0;
ImageEnVect.Layers[LayerCurr].Name := '001.jpg';

//Add Mask Layer
ImageEnVect.LayersAdd;
ImageEnVect.CurrentLayer.Assign(ievMain.Layers[LayerCurr]);
ImageEnVect.CurrentLayer.Bitmap.PixelFormat := ie8g;
ImageEnVect.Proc.Fill(clwhite);
ImageEnVect.CurrentLayer.Width := 550;
ImageEnVect.CurrentLayer.Height := 800;
ImageEnVect.CurrentLayer.Visible := True;
ImageEnVect.CurrentLayer.IsMask := True;
ImageEnVect.CurrentLayer.Visible := False;

//Load Another File
ieTemp.IO.LoadFromFile('002.jpg');

ieTemp.Proc.Resample(-1, 800, TResampleFilter(4))

LayerCurr := ImageEnVect.LayersAdd;
ImageEnVect.Layers[LayerCurr].Assign(ieTemp.CurrentLayer);
ImageEnVect.Layers[LayerCurr].PosX := 600;
ImageEnVect.Layers[LayerCurr].PosY := 20;
ImageEnVect.Layers[LayerCurr].Name := '002.jpg';

//Add Mask Layer
ImageEnVect.LayersAdd;
ImageEnVect.CurrentLayer.Assign(ievMain.Layers[LayerCurr]);
ImageEnVect.CurrentLayer.Bitmap.PixelFormat := ie8g;
ImageEnVect.Proc.Fill(clwhite);
ImageEnVect.CurrentLayer.Width := 550;
ImageEnVect.CurrentLayer.Height := 800;
ImageEnVect.CurrentLayer.Visible := True;
ImageEnVect.CurrentLayer.IsMask := True;
ImageEnVect.CurrentLayer.Visible := False;


ieTemp.Free;


//Save File using SaveAll
ImageEnVect.SaveToFileAll('MyFileSample.iev', ioPNG);

//Create a JPG thumbnail for viewing in Win Explorer
ImageEnVect.LayersCurrent := 0;

ImageEnVect.Proc.AutoUndo := False;
ImageEnVect.Proc.SaveUndo();
ImageEnVect.LayersMergeAll();

ImageEnVect.Proc.Resample(300, -1, TResampleFilter(rfBSpline));
ImageEnVect.IO.SaveToFileJpeg('MyFileSample.jpg');
ImageEnVect.Proc.Undo(False);  //Does not seem to work I don't know as why
ImageEnVect.Proc.AutoUndo := True;


The code is straight forward but the jpg is getting saved as grayscale.

Why?

TIA


Yogi Yang
4   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Jul 24 2016 : 04:30:49
Hi

I'm afraid you have sent an entire application. Is not practical for us to try and debug that. Please create a very simple demo that shows the issue.



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
yogiyang Posted - Jul 22 2016 : 00:23:20
Hello Nigel,

Did you receive the download link in you mail box?

Did you manage to download the code sample?

TIA


Yogi Yang
yogiyang Posted - Jul 19 2016 : 11:17:49
Source files sent through www.wetransfer.com.

TIA


Yogi Yang
xequte Posted - Jul 18 2016 : 20:01:45
Hi Yogi

I cannot reproduce that. Can you email me your source files?



Nigel
Xequte Software
www.xequte.com
nigel@xequte.com