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
 TImageEnView Load (png 24bit image), Save (png 8bit paleted white transparency

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
andyhill Posted - Sep 04 2021 : 18:26:10
ColorPalette:= TIEColorPalette.Create(nil);

ie:= TImageEnView.Create(nil);
//ie.LegacyBitmap:= True;
ie.IO.NativePixelFormat:= True;
//ie.EnableAlphaChannel:= True;
ie.IO.LoadFromFilePng(UniServerModule.EXEDir+'temp\temp.png');

if ie.IEBitmap.PixelFormat <> ie8p then begin
  ie.IEBitmap.PixelFormat:= ie8p; // FAILS TO CHANGE
end;

ColorPalette.AssignPalette(ie, False, True);
ie.IEBitmap.SetTransparentColors(clWhite, clWhite, 0);
ColorPalette.Free;


Please advise how to LoadFromFilePng, SaveToFilePng (8bit paleted with white transparent background) - thanks

I want to save ie to a PNG File with a White Transparent Background (8bit preferable but 24bit is OK too).

Andy
11   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Oct 12 2021 : 22:37:39
We have fixed the issue of 8bit color PNG not supporting 1bit transparency.

Nigel
Xequte Software
www.imageen.com
xequte Posted - Sep 08 2021 : 05:58:45
Hi Andy

IEGlobalSettings().ActivePngEngine just shows what engine is being used. If you have not added ielib64.dll to your exe folder, then it will be ieWIC. Is the problem resolved if you use ielib64.dll?

https://www.imageen.com/help/TIEImageEnGlobalSettings.PNGEngine.html
https://www.imageen.com/help/TIEImageEnGlobalSettings.ActivePNGEngine.html

Nigel
Xequte Software
www.imageen.com
andyhill Posted - Sep 08 2021 : 04:47:15
IEGlobalSettings().ActivePngEngine();

Does not work on its own, please show code as to how to implement and what to set it for 64bit applications ?.

Andy
xequte Posted - Sep 08 2021 : 04:11:22
Hi Andy

I used the code and source you sent. It produces a valid image for me.

What version of Delphi are you using?

Are you creating a 32bit or 64bit EXE? If 64bit, what is the value of:

IEGlobalSettings().ActivePngEngine();



Nigel
Xequte Software
www.imageen.com
andyhill Posted - Sep 06 2021 : 22:07:32
I have wrestled with this problem for a very long time ...

WHENEVER I use TImageEnView to ReSample a PNG Image the PNG Image Pallet (transparency color goes haywire) resulting in BLACK Image.

Please provide work around ASAP (it is urgent) - Thank You


Andy
andyhill Posted - Sep 06 2021 : 19:48:56
I have had issues hence my posting so I am glad you have found something to fix :)

Andy
xequte Posted - Sep 06 2021 : 18:30:19
Hi Andy,

Sorry, to be clear only 32bit PNG (and 8bit grayscale PNG) support full alpha transparency.

8bit color PNG can support 1bit transparency (i.e. not alpha).

Though in my tests today, I encountered an issue with that, so we'll need to investigate further.



Nigel
Xequte Software
www.imageen.com
andyhill Posted - Sep 06 2021 : 16:09:28
I use Corel PhotoPaint and it can make PNG Transparent Images on a few formats including 8bit Paleted ?

Andy
xequte Posted - Sep 06 2021 : 03:54:46
Hi Andy

Only a 32bit PNG file supports alpha, so are you wanting to turn the white pixels transparent and then save as a transparent PNG?

Nigel
Xequte Software
www.imageen.com
andyhill Posted - Sep 06 2021 : 01:10:36
I want Transparency.

When ever I resample (scale) I loose transparency.

Please show me how to load JPG/PNG file (assume 24bit) - Save as PNG file with transparency.

Jpg-24bit ---> Resample (downsize) ---> Png-8bit (with White Transparency).



Andy
xequte Posted - Sep 06 2021 : 00:48:52
Hi Andy

Do you mean like this:

  // Convert a 32bit PNG file to an 8bit PNG (without transparency)

  ImageEnView1.IO.LoadFromFile( 'D:\Alpha.png');

  // Remove alpha channel and make background white
  ImageEnView1.IEBitmap.RemoveAlphaChannel( True, clWhite );

  // Set PixelFormat to 8bit
  ImageEnView1.IEBitmap.PixelFormat := ie8p;

  // Use PixelFormat as authoritative source of bit-depth
  IEGlobalSettings().AutoSetBitDepth := True;

  ImageEnView1.IO.SaveToFile('D:\No-Alpha.png');


Nigel
Xequte Software
www.imageen.com