Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
gimp native batch convert?
(05-27-2023, 07:57 AM)Ofnuts Wrote: Filters ➤ Python-fu ➤ Console  ➤ Browse and ennter DDS in the search bar:

And if you hit Apply the python console is pre-filled with a call:

So, possibly, using the same names as in the python example code:

pdb.file_dds_save(image, drawable, outfile, outfile, 7, 0, 0, 0, 0, 7, 0, True,True,2.24,True,False,.5)

Where the 7 is the documented value for RXGB (DXT5).

The python documentation should be read with a grain of salt because it is auto-generated from the same sources as the script-fu docs and Pythin and Scheme have a different syntax.
  • Dashes in variable/constant names should be replaced by underscores
  • When present, the run-mode first argument should be ignored, it is not used in Python (it is actually optional, and specified differently)
  • Toggles that are specified as INT32 can be entered as boolean (False: 0, True: 1, and mind the initial capital). This is a bit more readable.
  • Many calls define constants names for their arguments when necessary, better use them when they exists (alas, not for the DDS plugin, it they had existed you could have used DDS_FORMAT_RXGB_DXT5 and DDS_MIPMAPS_NONE that are a bit less mysterious than 7 and 0)
  • For long calls, you can also enter the call like this, to put a comment with each argument, only the first line needs to be correctly indented:
pdb.file_dds_save(image, drawable, outfile, outfile,
                    7,      # DDS type
                    0,      # no mipmaps
                    0,      # save layer
                    0,      # Default pixel format
                    0,      # Transparent color is First
                    7,      # Lanczos filtering
                    0,      # Default wrap mode
                    True,   # gamma-correct filtering
                    True,   # Use sRGB
                    2.24,   # Gamma value
                    True,   # Perceptual compression
                    False,  # Preserve alpha
                    .5,     # Alpha (ignored, due to previous)

ok thanks I will try that

Forum Jump: