Thread: Batch image processing transparency method

Results 1 to 5 of 5
  1. #1
    REE3 The303's Avatar  
    Contributor
    Join Date
    Jul 2015
    Posts
    397

    Batch image processing transparency method

    So while pursuing an unrelated method on sprites, I have come across a method of fast and efficient batch processing of images with either an alpha channel targa or built-in like PNG that thresholds and converts to pure blue. This is incredibly useful because normally I wasted tons of time dealing with clipping masks, thresholds and collapsing layers in photoshop for just one by-one images. It requires you install imagemagick

    Now I pulled up a folder of mixed PNGs and TGAs with transparency/alpha from years ago when I was making tons of source spraylogos (these are already power of 2 images). I opened up console, went to my dir and put in this for imagemagick:

    convert * -compress None -channel alpha -threshold 50% +channel -background #0000ff -alpha background -alpha off -colors 256 bmp3:{img.bmp
    (note that * can be changed with *.tga or *.png if you specifically want just those or whatnot.)

    Once imagemagick runs its course drag and drop the new BMPs into wally. Also since I specified "{img" on the filename all our images have already been prepared for transparency.

    Make your func_wall or func_illusionarys as needed:

    Final result.


    Note you can also adjust the threshold percentages in your command line to fully eliminate things like shadows. Notice on some there is still a shadow since my originals had a gradient fade. This saved an asston of work.
    Also would anyone know a command to preserve original image filenames?

  2. #2
    QPU-aligned Silencer's Avatar  
    Contributor
    Join Date
    May 2006
    Posts
    6,078

    Re: Batch image processing transparency method

    Some command-line processing on images is actually very useful sometimes. Especially when dealing with data images like normal maps. Good tutorial!

    Also nice memes yo.

  3. #3
    Administrator AdamR's Avatar  
    Manager
    Join Date
    Mar 2004
    Location
    Cardiff, South Wales [UK]
    Posts
    8,581

    Re: Batch image processing transparency method

    Nice tutorial.

    For those wanting a graphical tool IrfanView is capable of batch processing images into BMP and TGA format but probably not with the transparency setting ImageMagick can do.



    Moved to the tutorials sub-forum.
    Adam "Adambean" Reece
    Sven Co-op team

    Also on: Steam | Facebook | Twitter | YouTube | Twitch
    Released AMXX plug-ins: Bind number slots | NextMap with Sven Co-op fix | Sven Co-op administrator icons

  4. #4
    REE3 The303's Avatar  
    Contributor
    Join Date
    Jul 2015
    Posts
    397

    Re: Batch image processing transparency method

    Quote Originally Posted by AdamR View Post
    Nice tutorial.

    For those wanting a graphical tool IrfanView is capable of batch processing images into BMP and TGA format but probably not with the transparency setting ImageMagick can do.



    Moved to the tutorials sub-forum.
    Ah thanks for moving, it was late and I was tired and didn't notice I wasn't in tutorials.

    Also, speak of the devil, I was just writing a similar method using IRFANVIEW for a friend who had a bunch of old ripped textures he wanted converted to goldsrc easily:
    http://www.the303.org/tutorials/gold_texture_px.htm

    IRFANVIEWS batch processor is frigging amazing, like just look at all those advanced options. Not as powerful per say as imagemagick but for 90% of tasks its easy and the best.

  5. #5
    Registered User
    Join Date
    Jul 2010
    Posts
    52

    Re: Batch image processing transparency method

    Very Helpful! Currently using the irfanview process. Does imagemagik install on windows?

Posting Permissions

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