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
 32-bit PNG (RGBA) support

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
Eric24 Posted - Mar 23 2013 : 13:08:35
I have an older version of ImageEn (3.1.2). Is there a known problem with reading 32-bit RGBA PNG files?

Specifically, I'm loading the 32-bit PNG, converting it to grayscale, optionally resamping it, and then saving it as a grayscale PNG. The final result is essentially a corrupted PNG file. It works fine for 8-bit or 24-bit PNGs.

Simplified code snippet:
FoImage.IO.LoadFromFilePNG(Filename);
FoImage.Proc.ConvertToGray;
FoImage.IEBitmap.PixelFormat := ie8g;
FoImage.IO.Params.BitsPerSample := 8;
FoImage.IO.Params.SamplesPerPixel := 1;
FoImage.IO.SaveToFilePNG(Filename);
8   L A T E S T    R E P L I E S    (Newest First)
xequte Posted - Mar 13 2016 : 22:54:59
Hi Matteo

I'm afraid that is not fixed until 6.2.3.

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
MTW Posted - Mar 10 2016 : 05:09:56
Hello,
I have version 6.0.0, when I convert to grayscale (ie8g) and try to save to file, I get a monochrome image!!

here is my code:

  ImageEnView1.IO.LoadFromFileAuto('d:\test_image_24RGB.jpg');
  ImageEnView1.IEBitmap.PixelFormat := ie8g;
  ImageEnView1.IEBitmap.Write('d:\test_image_8g.png');


I took a look into TIEBitmap.Write and I saw:

ie8g:
          begin
            io.Params.BitsPerSample := 1;
            io.Params.SamplesPerPixel := 1;
            io.Params.JPEG_ColorSpace := ioJPEG_GRAYLEV;
          end;


but, shouldn't be io.Params.BitsPerSample := 8?
I have tried to modify the source and it seems to work..

I have also added defaults for J2000 and TGA (just in case):
io.Params.J2000_ColorSpace := ioJ2000_GRAYLEV;
io.Params.TGA_GrayLevel := true;


Is this problem addressed in 6.2.2?

thank you in advance
Matteo
Eric24 Posted - Mar 28 2013 : 13:24:45
Actually, that's a pretty good idea. I'll try it. Thanks!
fab Posted - Mar 28 2013 : 13:22:57
ImageEn updates are notifies in this forum.
Just a stupid hint (but I have to write here...): If you don't need the alpha channel you can remove it running FoImage.RemoveAlphaChannel(). This will produce a non corrupted gray scale PNG.
Eric24 Posted - Mar 28 2013 : 13:16:53
No problem. It's not a huge problem (we don't encounter 32-bit PNGs very often). Please let me know when the new release is out and I'll plan to upgrade then.
fab Posted - Mar 28 2013 : 13:15:03
You're right.
However this problem is still present on current version, and it will be fixed in next minor release.
I cannot patch 3.1.2 version.
Eric24 Posted - Mar 28 2013 : 12:58:03
Perhaps, but it works as-is on all other PNGs (only 32-bit files fail).
fab Posted - Mar 28 2013 : 12:55:56
I am not sure, but you should not set PixelFormat=ie8g under 3.1.2. Leave it ie24RGB. The PNG codec will automatically convert the output to 8 bit gray scale (looking at BitsPerSample and SamplesPerPixel).