Results 1 to 6 of 6

Thread: png transparency always lost

  1. #1
    IV Newbie
    Join Date
    Jun 2008
    Posts
    2

    Question png transparency always lost

    hey,
    i'm sorry if this has been brought up before. i've searched and found several topics concerning around this but none really solved my problem, so i thought i should open a new thread after all.

    i have an image with indexed colour of which 161 are unique colours. i am editing it in photoshop. it also has a transparent colour.
    when i open the psd in irfanview, the transparency is replaced with white. when i save it as gif, the transparency again turns into white. opening the same gif in photoshop will show the transparency fine though. when i save the psd as png, the background in irfan is no longer white but black. i'm presuming that's because it interprets transparency correctly now? (is there any way to enable a checkerboard for transparency like in photoshop?)
    i've noticed in photoshop, you cannot change between the 1-9 levels that irfan offers for png compression. (what are the differences here anyway? png is lossless, right? so what's the difference?)
    therefore, i wanted to save the photoshop png as an irfan png with compression set to 9 in order to save filesize. (every kb counts for me in this case)
    it comes up with a dialog to select the transparent colour. something i don't understand. doesn't it already interpret transparency correctly? why must i reassign it now? in the dialog it shows the transparent colour as black. of course i cannot key this out as my image contains regular black colour in places.

    thanks a lot for your support.

  2. #2
    Moderator Sam_Zen's Avatar
    Join Date
    May 2007
    Location
    NL
    Posts
    1,897
    Version
    IrfanView 4.27
    OS
    Win XP Home SP1
    CPU Cores
    1

    Default

    IrfanView unfortunately doesn't use a checkerboard for the transparency.
    It uses the color set in the Properties/Viewing dialog as the 'Main window color'.
    So in order to get a clear distinction, it's better to have this color not set as black, but as some 'odd' color.

    If the source file already has a defined transparent color, one can disable the selection of transparency in the PNG dialog. Otherwise you have to pick some pixel before saving.

    Afaik the 1-9 levels have more to do with the speed of decompressing the file to show it, than with filesize.
    0.6180339887
    Rest In Peace, Sam!

  3. #3
    Moderator Bhikkhu Pesala's Avatar
    Join Date
    May 2007
    Location
    East London
    Posts
    4,236
    Version
    IrfanView 4.38
    OS
    64-bit Win 7 Home Basic
    CPU Cores
    1

    Default

    A quicker solution than PNGOUT, and one that doesn't require loading the image in IrfanView is to use pngcrush from Sourcefourge.

    Download the ZIP file and extract to a suitable folder — say C:\Program Files\pngcrush\ and rename the executable if you wish as I did to pngcrush.exe.

    From the Tools menu of Control Panel, select Folder Options, File Types, and scroll down to the PNG file type. Click on Advanced, and add a new action called "Crush." In the field "Application used to perform action" enter the path to pngcrush.exe like this:

    "C:\Program Files\pngcrush\pngcrush.exe" -e 2.png "%1"

    The parameter -e 2.png will append "2" to the current file name. The new action will now be added to the Windows Explorer shell menu whenever a PNG file is selected.

    Off-topic discussion split off to Compressing PNG Images in the Software Forum.
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	PNG Folder Options.png 
Views:	1206 
Size:	26.3 KB 
ID:	706   Click image for larger version. 

Name:	PNG Action.png 
Views:	1147 
Size:	12.0 KB 
ID:	707   Click image for larger version. 

Name:	PNG Crush Action.png 
Views:	761 
Size:	5.9 KB 
ID:	708  
    Last edited by Bhikkhu Pesala; 29.06.2008 at 05:03 PM.

  4. #4
    Multiple User j7n's Avatar
    Join Date
    Jun 2006
    Location
    Cyberspace
    Posts
    464
    Version
    IrfanView 4.20
    OS
    32-bit Win XP Pro SP1
    CPU Cores
    1

    Default

    Decompression speed and ratio depend mostly on the chosen preprocessor filter.

  5. #5
    IV Newbie
    Join Date
    Jun 2008
    Posts
    2

    Default

    okay, thanks for the replies guys. i understand this better now.
    however, i came across another problem.

    how can you save the transparency channel when resizing an image? i take it through resampling, the transparency is lost? is there any way to prevent this?

    the image is still 161 colours (+ transparency) and originally about 2500x1800px. i would like to reduce it to 680px in width. my idea was to set to rgb, resize, set back to indexed colour (reduce colours) using the steinberg floyd dithering irfan offers. good idea?
    my problem now is the loss of the transparency.

    how can this be done?
    also when i leave it at rgb, the transparency will be lost, unfortunately =/
    i understand when resizing, it mixes the colours together to create the smaller image. but can't it mix in transparency as well?
    Last edited by posix; 10.07.2008 at 02:57 PM.

  6. #6
    Moderator Frank's Avatar
    Join Date
    Nov 2005
    Location
    Berlin, Germany
    Posts
    1,527
    Version
    IrfanView 4.37
    OS
    64-bit Win 7 Professional SP1
    CPU Cores
    2

    Default

    Version 4.28 (Release date: 2010-12-16)
    • New PNG save option: Save transparency as Alpha channel (Thanks to Thomas Henlich)

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •