[SE] Converting transparent PNG to GIF loses transparency

Ask for help and post your question on how to use XnView Classic.

Moderators: XnTriq, helmut, xnview

anonymous_user

[SE] Converting transparent PNG to GIF loses transparency

Post by anonymous_user »

<-- Moderator's note: This topic has been split off from “XnView Shell extension”. -->

When I use the shell extension to convert a transparent PNG to GIF, it loses the transparency and gets a black background. Any ideas?
User avatar
XnTriq
Moderator & Librarian
Posts: 6168
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Post by XnTriq »

anonymous_user wrote:When I use the shell extension to convert a transparent PNG to GIF, it loses the transparency and gets a black background. Any ideas?
:arrow: Loading GIF, removing transparency, saving JPG
anonymous_user

Post by anonymous_user »

Sorry for mentioning earlier, but I dont want to change the background color. I want it to stay transparent. Last I checked GIF does support transparency.
User avatar
XnTriq
Moderator & Librarian
Posts: 6168
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Post by XnTriq »

Converting truecolor PNG images to GIFs will inevitably result in loss of transparency, because the color depth has to be reduced to 8-bit in the process.

When an 8-bit PNG is converted to GIF format on the other hand, the transparency index of the source image's palette is maintained.
anonymous_user

Post by anonymous_user »

Paint.NET lets me save PNGs as GIF without losing transparency. I guess XnView doesnt? :(
User avatar
xnview
Author of XnView
Posts: 39322
Joined: Mon Oct 13, 2003 7:31 am
Location: France

Post by xnview »

anonymous_user wrote:Paint.NET lets me save PNGs as GIF without losing transparency. I guess XnView doesnt? :(
It's impossible to keep 24bits with alpha in gif format, you don't choose a transparency index?
Pierre.
User avatar
XnTriq
Moderator & Librarian
Posts: 6168
Joined: Sun Sep 25, 2005 3:00 am
Location: Ref Desk

Post by XnTriq »

Programs like Photoshop/ImageReady and Fireworks are capable of reducing an images bit depth from truecolor to indexed color without loss of transparency.
But these are full-fledged image editors.