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

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
Forum membership is Free!  Click Join to sign-up
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 Photoshop PNG to BMP convert problem
 New Topic  Reply to Topic
Author Previous Topic Topic Next Topic  

microtech

Germany
2 Posts

Posted - Apr 01 2015 :  02:33:31  Show Profile  Reply
Hello,

we use the latest version of ImageEn (Build 6.0.0.25.9884).

Our customer wants to convert a transparent PNG file to BMP.
He creates the PNG file with Photoshop.

But after the conversion the output BMP has fragmented segments
of different colors on the former-transparent parts of the image.

We use this code:

var
  bmp: TIEBitmap;
begin
  bmp := TIEBitmap.Create;
  try
    bmp.Read('C:\input.png');
    bmp.Write('C:\output.bmp');
  finally
    bmp.Free;
  end;
end;


Does anyone has an idea how to fix this issue?


xequte

38510 Posts

Posted - Apr 01 2015 :  02:51:06  Show Profile  Reply
Hi

Can you also attach your source PNG file.

Also, try calliing RemoveAlphaChannel prior to saving:

http://www.imageen.com/help/TIEBitmap.RemoveAlphaChannel.html

Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page

rmklever

Norway
51 Posts

Posted - Apr 01 2015 :  04:43:11  Show Profile  Reply
Hi,

Before saving it as a bmp file you need to render the image to a white or black background image without alpha channel. That should fix the problem. Bmp does not support transparencies.

Hope this helps.


Roy M Klever
Klever on Delphi - www.rmklever.com
Go to Top of Page

microtech

Germany
2 Posts

Posted - Apr 01 2015 :  07:11:21  Show Profile  Reply
Thanks, the function RemoveAlphaChannel(True) fixed the problem.
Go to Top of Page

xequte

38510 Posts

Posted - Apr 14 2015 :  01:48:35  Show Profile  Reply
Hi

FYI, in the next update it will auto-merge for non-alpha formats.


Nigel
Xequte Software
www.xequte.com
nigel@xequte.com
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
Jump To: