Search code examples
batch-filealpha

Convert black parts of an image to transparent parts by batch file


Hi guys I'm an animator working with textures that some of them need to Convert black parts of an image to transparent parts and it's really boring to sit and all the day do it with photoshop can't I do it with a batch file?tnx.


Solution

  • Another Way is to use these 2 commands :

    PNG2HEX.EXE

    This will decompose your image in one pixel (in Hexa value) per line.

    Then you can parse the output file and replace each ALPHA CHANEL from FF TO 00 (000000FF to 00000000 for BLACK -> Transparent)

    and then rebuild it with

    HEX2PNG.EXE

    These examples are in FRENCH but if you have some problem I can make you an example in English.

    You can build you're own filters in BAT with these commands.

    Sure the imageMagick solution is easier (the filter is already done !). But if you want to make your own filters (steganographic, gray level,...) It stay a very good solution.

    Download : https://goo.gl/614NH8