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, January 6, 2010 11:54:07 AM(UTC)

GregR  
GregR

Groups: Registered, Tech Support, Administrators
Posts: 764


A common need is to convert an image with transparency (such as a PNG) to a format that does not have transparency (such as JPEG).  With LEADTOOLS, if you do a simple load and save, you will lose the alpha channel and the image will not look exactly the same.  Therefore you must make a background image (usually just a solid color) and blend the alpha channel and base image together with the FeatherAlphaBlendCommand.  This C# 2005 examples uses the .NET 16.5 interface to convert a transparent PNG file to a JPEG so that it will have the same look and feel as if it were displayed in Windows Picture and Fax Viewer (white background).
File Attachment(s):
NET - v16 - PNG to JPEG FeatherAlphaBlend.zip (15kb) downloaded 382 time(s).
 

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, August 20, 2012 5:22:15 AM(UTC)

Walter  
Walter

Groups: Tech Support
Posts: 366

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

This project has been updated for use with LEADTOOLS v17.5 and Visual Studio 2010.
File Attachment(s):
NET - v17.5 - PNG to JPEG FeatherAlphaBlend.zip (125kb) downloaded 330 time(s).
Walter Bates
Senior Support Engineer
LEAD Technologies, Inc.
LEAD Logo
 
#3 Posted : Sunday, June 23, 2013 10:45:53 PM(UTC)

Tamer_Irdais  
Guest

Groups: Guests
Posts: 3,022

Was thanked: 2 time(s) in 2 post(s)

Using an additional byte for each pixel to store an alpha mask (alpha channel) is a very common approach for representing transparency.
Many applications, both based on LEADTOOLS and non-LEAD imaging engines, support it in a uniform manner. Attached screenshot shows how MS Excel displays a 32-bit PNG file that has an alpha channel when that image is simply inserted into the sheet.
Guest attached the following image(s):
ExcelPng32.jpg
 
#4 Posted : Thursday, June 14, 2018 4:54:21 PM(UTC)

Walter  
Walter

Groups: Tech Support
Posts: 366

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

Attached is an updated project that can target LEADTOOLS versions 16.5, 17.5, 18, 19, and/or 20. You can use the configuration for whichever version of LEADTOOLS you have on your machine.

To run this project, please extract it to the following directory:
C:\LEADTOOLS <version>\Examples\posts\t8052
File Attachment(s):
NET - PNG to JPEG FeatherAlphaBlend.zip (38kb) downloaded 305 time(s).
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.166 seconds.