Announcement

Collapse
No announcement yet.

Batch, keeping original Transparency

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Batch, keeping original Transparency

    Hello everybody,

    I have a question, perhaps anybody knows the solution...

    When resizing my gifs with batch processing (which is incredibly fast!), I want to keep the transparent parts of the original gifs transparent. But it seems like Irfanview colors the transparent parts in black (or whatever I define as background - options/settings/viewing) and I have to choose before batch processing that the black parts have to be transparent. But then, all black parts of the pictures are transparent. And even if there are no other black parts, the result is not so great: There is a black/grey border around the non-transparent parts of the picture.

    Did I do something wrong?

    greets,
    wilo

    #2
    No, it's not your fault. This is partly an old issue, one that I would like to see fixed -- that transparency can't be retained automatically.

    But there's another problem in resizing. Unless you choose "Resize" rather than "Resample", the color depth is changed from 256 colors -- 8 bits per pixel -- to 24 bits and then back to 8 bit when it's re-saved as a GIF. In resampling, edges are blurred, so that the original transparency can't be restored cleanly. So keeping transparency doesn't help much.
    Its: Belongs to "It"
    It's: Shortened form of "It is"
    ---------------------
    Lose: Fail to keep
    Loose: Not tight

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

    Comment


      #3
      All that Matera says is true. It does not solve the problem but it helps if you select a background color (Properties> Viewing> Main window color) that is as different as possible to anything likely to be found in your image. Black is not usually a good choice.

      Comment


        #4
        Well, thx a lot! I tried the trick with the background (green) color, but it didn't work out for me because in the end I had a green border around the object...

        Comment


          #5
          It's all about straight resizing vs. resampling when you resize. The eges are blurred, antialiased, blended with the background color, when the image is resampled. "Resizing" in this context means simply multiplying each pixel, while resampling means creating pixels at the edge where two colors meet that are a blend of the different colors. Each method has a different purpose. Resampling gives an eye-pleasing smoothness to edges in a photo that has been shrunk or enlarged.

          You can try filling the background using the IrfanPaint plugin, adjust the fill tolerance until it makes a clean edge -- but it will never be quite as good an edge as the original.

          Resizing images that have sharp edges usually gives poor results. That's the way they are.
          Its: Belongs to "It"
          It's: Shortened form of "It is"
          ---------------------
          Lose: Fail to keep
          Loose: Not tight

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

          Comment


            #6
            Originally posted by wilo View Post
            Well, thx a lot! I tried the trick with the background (green) color, but it didn't work out for me because in the end I had a green border around the object...
            Sorry if I confused you. There are two issues here. Since Irfanview does not support transparency internally, the transparent color is replaced by the main window (background) color when you open a Gif and you then have to select it again when you Save.
            As long as you do not do anything to change the color palette while you are editing, all is well, even if you do have an identical area of color within the image itself. If any operation changes the palette though it is quite possible for the color of the main window to be combined with that of an identical or close color area within the image and then that area turns transparent too when you save. That is why I said to choose a main window color as different as possible from anything in the image.

            The other issue is the one Matera warned you about if you use Resample. Your Gif is converted to a 24 bit truecolor image (like a Jpeg) to perform this operation. Colors are changed during Resampling close to the boundaries and in most cases these changed colors are not recombined with the original when the image is converted back to an 8 bit palette to save as a Gif. Hence the residual band of green around the object that no longer matches the transparent color you select. The solution, as Matera says, is to use Resize not Resample when working with Gifs.

            Be warned though that there are other functions that do this conversion to 24 bit truecolor as well. Sharpen and Auto adjust colors are two that come to mind.

            Comment

            Working...
            X