Page 1 of 2 1 2 LastLast
Results 1 to 10 of 13

Thread: Problem reading transparent GIFs

  1. #1
    IV Newbie
    Join Date
    Dec 2009
    Location
    Sofia, BULGARIA
    Posts
    6
    Version
    IrfanView 4.25
    OS
    32-bit Win XP Pro SP2
    CPU Cores
    1

    Default Problem reading transparent GIFs

    I am using IrfanView 4.25, but I have seen this bug from 3.92 upwards (and I believe it was started even earlier).
    I have a GIF with my company logo and its background is transparent.
    When I open this GIF into IrfanView - it does not recognize the transparent color and allways forces it to BLACK.
    You will say that I can choose a transparent color when I save the GIF back - but then arises the real problem, because I have BLACK areas in my logo already.
    So, when I try to save this GIF back - IrfanView allows me to set a transparent color by clicking. And I click on the background - but since it is now black (because of the wrong behaviour of IrfanView when loading the file in the beginning), as a result my logo has now transparent background AND the original black areas (the name of the company) are now ALSO transparent.
    When I load/save the same GIF with another tool (Pixel Editor) - the transparent background is properly preserved.
    I have tested other GIFs and ICOs - and each time the transparent color is silently converted to black by IrfanView.

    You can check yourself using this address
    http://crm.walltopia.com/test/images/menu/logo.gif
    Attached Thumbnails Attached Thumbnails Click image for larger version. 

Name:	logo.gif 
Views:	129 
Size:	2.8 KB 
ID:	1924  

  2. #2
    Moderator Enterprise User Bhikkhu Pesala's Avatar
    Join Date
    May 2007
    Location
    East London
    Posts
    6,326
    OS
    64-bit Win 10
    CPU Cores
    1

    Default

    The background colour for transparent images in IrfanView is set in Properties, Viewing, main window colour. The default is black, but you can change it to whatever you want.

    There is no checkerboard pattern to display transparency, as there is in Photo-editing programs.

    The transparent "colour" is not changed on loading transparent images. IrfanView only support 24-bit palettised transparency, not 32-bit alpha transparency, so it is not suitable for editing 32-bit icons.

  3. #3
    IV Newbie
    Join Date
    Dec 2009
    Location
    Sofia, BULGARIA
    Posts
    6
    Version
    IrfanView 4.25
    OS
    32-bit Win XP Pro SP2
    CPU Cores
    1

    Default

    Okay, if what you are saying
    "The transparent colour is not changed on loading transparent images."
    is true - then on saving it should retain/preserve that transparent colour, right ?
    But it does not - it forces me to choose:
    1. Eigher click inside the image - and select a NEW transparent colour
    2. Or press "ESC" to ignore transparency at all

    I do not bother for checkerboard pattern - but I do want that IrfanView does not change the transparent colour to its main window colour. If it HAS to change the colour (which I think is not a very wise behaviour) - then why it "forgets" to restore it back when I try to save the image ?

    I do not know how IrfanView works - but probably it is similar to this:
    1. Non-paletted images are loaded as they are
    2. Paletted images are first internally converted to a non-paletted one
    I suppose that in this internal conversion the transparent colour is lost and the main window color is used instead.

    My suggestion is - let IrfanView compute an unused 24-bit RGB colour (certainly there would be one for every possible picture in the world) and
    use it instead of the main window colour.
    Then when I save my image - I can click on this colour and be sure that it will not destroy any other colour in the image.

    Does this sound very hard to implement or it just does not worth (it worths for me) ?

  4. #4
    Moderator Enterprise User Bhikkhu Pesala's Avatar
    Join Date
    May 2007
    Location
    East London
    Posts
    6,326
    OS
    64-bit Win 10
    CPU Cores
    1

    Default

    IrfanView is loading the file as a bitmap in memory. If you want to change the background colour, open IrfanPaint (F12) and use the flood-fill tool.

    If you want to edit images extensively, perhaps IrfanView is not the right tool for you — it is an image viewer at heart. I would regard alpha transparency as a basic requirement of a photo-editor.

  5. #5
    IV Newbie
    Join Date
    Dec 2009
    Location
    Sofia, BULGARIA
    Posts
    6
    Version
    IrfanView 4.25
    OS
    32-bit Win XP Pro SP2
    CPU Cores
    1

    Default

    Quote Originally Posted by Bhikkhu Pesala View Post
    IrfanView is loading the file as a bitmap in memory. If you want to change the background colour, open IrfanPaint (F12) and use the flood-fill tool.

    If you want to edit images extensively, perhaps IrfanView is not the right tool for you — it is an image viewer at heart. I would regard alpha transparency as a basic requirement of a photo-editor.

    I do not want to edit images extensively. Most of the time, I am using IrfanView for one of these:
    1. Convert between image formats
    2. Resize / resample images
    3. Decrease color depth

    Therefore, if I should set the main window background colour to an unusual value every time I load transparent image - I will consider this an extra difficulty for the user in favor of more easy / lazy programming.
    As I already suggested - IrfanView could be modified to behave differently when loading transparent image (to temporarily change the background colour of main window to some other colour, which is not used in the image being loaded).

    But probably, as you said - IV might not be the right tool to convert between images ...

  6. #6
    Professional User Mij's Avatar
    Join Date
    Mar 2007
    Location
    Camberley, Surrey, UK
    Posts
    2,763
    Version
    IrfanView 4.51
    OS
    32-bit Win 10
    CPU Cores
    3

    Default

    Quote Originally Posted by tmcdos View Post
    Okay, if what you are saying
    "The transparent colour is not changed on loading transparent images."
    is true - then on saving it should retain/preserve that transparent colour, right ?
    But it does not - it forces me to choose:
    1. Eigher click inside the image - and select a NEW transparent colour
    2. Or press "ESC" to ignore transparency at all
    It is rather bizarre. The only way I know of preserving the transparent color is to go to Image >Palette > Edit Palette and click on a transparent bit of the image (where the background canvas is showing through). That will highlight and display the palette entry number that was being used as the transparent color and is now displaying as canvas. Make a note of that number and when you save, check Set transparency value to palette entry and fill in the number you wrote down.

    If you do save using that option then next time you open the image in Irfanview you will see that it shows the number of the transparent color under Compression: in the Image Information.

    Clearly Irfanview must know which palette entry it replaced with canvas when it opened and IMHO should default to the Set transparency value.. option and fill in that entry number for you automatically when you save.

  7. #7
    IV Newbie
    Join Date
    Dec 2009
    Location
    Sofia, BULGARIA
    Posts
    6
    Version
    IrfanView 4.25
    OS
    32-bit Win XP Pro SP2
    CPU Cores
    1

    Default

    Quote Originally Posted by Mij View Post
    Clearly Irfanview must know which palette entry it replaced with canvas when it opened and IMHO should default to the Set transparency value.. option and fill in that entry number for you automatically when you save.
    This is exactly what was in my mind but I could not say so well as you (English is not my native language) !

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

    Default

    I agree about this color definition to be saved in the palette dialog.
    0.6180339887
    Rest In Peace, Sam!

  9. #9
    Advanced User matera's Avatar
    Join Date
    May 2006
    Location
    3 miles below poverty level
    Posts
    1,383
    Version
    IrfanView 4.44
    OS
    64-bit Linux Distribution
    CPU Cores
    4

    Default

    This is why I use an odd shade of blue-gray for background. It seldom matches anything important in an image. I like a black background, but when I open black-and-white images with transparency -- Oy!
    Its: Belongs to "It"
    It's: Shortened form of "It is"
    ---------------------
    Lose: Fail to keep
    Loose: Not tight

    ---------------------
    Plurals do not require apostrophes

  10. #10
    Professional User Mij's Avatar
    Join Date
    Mar 2007
    Location
    Camberley, Surrey, UK
    Posts
    2,763
    Version
    IrfanView 4.51
    OS
    32-bit Win 10
    CPU Cores
    3

    Default

    Yes, that's a good idea Matera. Using a distinctive color for the background means that you can select Choose transparent color during saving when you want to resave and easily find a transparent bit of the image to click on then.

    I see that it does not matter either if you do have that same color somewhere else in the image since that will have been saved already under a different palette entry number and will not become transparent.

    By the way, I should not have used the term Canvas in my earlier posts. It is the Main window color as set in the Viewing section of Properties/settings that forms the background and is seen in the transparent areas. Canvas can be set to a different color in the Add canvas dialog.
    Last edited by Mij; 04.12.2009 at 01:25 PM.

Thread Information

Users Browsing this Thread

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

Posting Permissions

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