LEADTOOLS Support
General
General Questions
HOW TO: Convert a Transparent Image to a Non-transparent Format (e.g. PNG -> JPG)
While some posts in this topic are more current, this topic was posted before the current version of LEADTOOLS was released and may no longer be applicable.
#1
Posted
:
Wednesday, January 6, 2010 11:54:07 AM(UTC)
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).
#2
Posted
:
Monday, August 20, 2012 5:22:15 AM(UTC)
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.
Walter Bates
Senior Support Engineer
LEAD Technologies, Inc.
#3
Posted
:
Sunday, June 23, 2013 10:45:53 PM(UTC)
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):
#4
Posted
:
Thursday, June 14, 2018 4:54:21 PM(UTC)
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
Walter Bates
Senior Support Engineer
LEAD Technologies, Inc.
LEADTOOLS Support
General
General Questions
HOW TO: Convert a Transparent Image to a Non-transparent Format (e.g. PNG -> JPG)
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.