Jump to content

Programmable Merging of Images


LHammonds

Recommended Posts

I've been thinking about this for a while now and now I'm determined to find a solution...which is why I am starting this thread.

 

I typically have multiple image files that get merged into a final DDS product. This takes a bit of time if you have a LOT of images.

 

I think it would be awesome if I could make a batch file that would re-compile all my source images into their final DDS format.

 

Examples:


Armor_DIFF.PNG = A diffuse color map

Armor_ALPHA.PNG = A transparency map

 

Armor_DIFF.PNG + Armor_ALPHA.PNG (in the alpha channel) + DDS Format (DXT5 + Mipmaps) = Armor.dds


Armor_NRM.PNG - A Normal Map

Armor_SPEC.PNG - A specularity map

 

Armor_NRM.PNG + Armor_SPEC.PNG (in the alpha channel) + DDS format (DXT5 + Mipmaps) = Armor_n.dds


iconArmor.PNG = An icon

iconArmor_ALPHA.PNG = A transparency map

 

iconArmor.PNG + iconArmor_ALPHA.PNG (in the alpha channel) + DDS Format (DXT3 + NoMipmaps) = iconArmor.dds


I am currently looking towards ImageMagik as a possible solution.

 

If I find a solution, I'll create a tutorial on how to accomplish it.

 

NOTES TO SELF:

- Merge Layers as TIF or TGA

- Use Convert with the "Set Alpha"

- DDS writing is not supported with ImageMagick, could use multi-layered TIF and converted with something else (maybe) or TGA file.

 

Command to EXTRACT an alpha channel from an image:

convert drawn.png -alpha extract mask.png

 

Command to COPY to an alpha channel from an image:

convert alpha_extract.png  -alpha copy   alpha_copy.png

 

Command to enable the Alpha channel for an image:

convert moon.png  -alpha off    -alpha set    alpha_set.png

 

Command to create TGA from a normal map + specular map

convert Armor_NORM.PNG Armor_SPEC.PNG -colorspace RGB -alpha Off -compose copy_opacity -composite Armor_n.tga

 

Command that lists supported file formats:

convert -list format

Result:

DDS* DDS       r--   Microsoft DirectDraw Surface

The above shows there is Read-Only support for DDS...meaning we can only convert from DDS, not write directly to DDS using ImageMagick.

 

DDS Utilities - This package includes "nvDXT.exe" which is a command-line program that can access the nvDXTlib functions...which may provide the end-result solution. ImageMagick can handle all preparations beforehand and nvDXT can create the DDS file.

 

NConvert - This can convert to and from DDS format in batch mode.

 

ATI Compress - ATI's library for compression and used by The Compressonator which can be used to batch create DDS files.

thecompressonator.exe -convert "armor.tga" "armor.dds" DXT1 -mipmaps
thecompressonator.exe -convert "armor_n.tga" "armor_n.dds" DXT5 -mipmaps
thecompressonator.exe -convert "iconarmor.tga" "iconarmor.dds" DXT3

 

Adobe Photoshop's Automate Batch - Can be used to automate the conversion of images to DDS format (if you have Photoshop and if you have NVidia DDS Plugin installed properly).

 

LHammonds

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...