Welcome Guest! To enable all features, please Login or Register.

Notification

Icon
Error

Options
View
Last Go to last post Unread Go to first unread post
#1 Posted : Wednesday, November 25, 2009 9:29:27 PM(UTC)
MikkelMortensen

Groups: Registered
Posts: 1


Hi

I have a PNG image with an alpha channel - this alpha channel is used to imitate a nice drop shadow on what ever background the PNG is shown on.

Currently I use LEADTOOLS (.NET) to resize the PNG.
Now I would like to flatten the image in the process and save it as a JPEG. White must be used as the background - so the shadiw must be cast on the white background.
How would you do that ?

Kind regards
Mikkel

 

Try the latest version of LEADTOOLS for free for 60 days by downloading the evaluation: https://www.leadtools.com/downloads

Wanna join the discussion? Login to your LEADTOOLS Support accountor Register a new forum account.

#2 Posted : Monday, November 30, 2009 7:10:13 AM(UTC)

Walter  
Walter

Groups: Tech Support
Posts: 366

Thanks: 1 times
Was thanked: 4 time(s) in 4 post(s)

Hello Mikkel,

In order to combine the Alpha channel data with the image data, you'll have to use either the AlphaBlendCommand or the FeatherAlphaBlend command to flatten the images together. These are both in the Leadtools.ImageProcessing.Effects namespace.

If you're loading the PNG from file with the alpha data, you'll need to specifically indicate to the RasterCodecs engine to load the extra alpha data with the raster image by specifying the higher bit depth.

You can use the RasterImage.CreateAlphaImage() method to create an image out of the alpha data to combine with the above methods.

There is an example in our help files illustrating how to use the aforementioned methods.
Walter Bates
Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF.NET | YAF.NET © 2003-2024, Yet Another Forum.NET
This page was generated in 0.085 seconds.