Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
gimp native batch convert?
#10
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:

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:
Code:
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)
                    )        
Reply


Messages In This Thread
gimp native batch convert? - by y2keeth - 05-22-2023, 12:39 AM
RE: gimp native batch convert? - by Ofnuts - 05-22-2023, 07:28 AM
RE: gimp native batch convert? - by y2keeth - 05-22-2023, 08:51 AM
RE: gimp native batch convert? - by y2keeth - 05-23-2023, 03:28 AM
RE: gimp native batch convert? - by Ofnuts - 05-23-2023, 12:38 PM
RE: gimp native batch convert? - by y2keeth - 05-24-2023, 04:55 AM
RE: gimp native batch convert? - by y2keeth - 05-26-2023, 01:21 AM
RE: gimp native batch convert? - by y2keeth - 05-27-2023, 05:21 AM
RE: gimp native batch convert? - by rich2005 - 05-27-2023, 07:25 AM
RE: gimp native batch convert? - by Ofnuts - 05-27-2023, 07:57 AM
RE: gimp native batch convert? - by y2keeth - 05-28-2023, 01:47 AM
RE: gimp native batch convert? - by y2keeth - 06-06-2023, 04:40 AM
RE: gimp native batch convert? - by Ofnuts - 06-06-2023, 07:04 AM
RE: gimp native batch convert? - by y2keeth - 06-07-2023, 03:06 AM
RE: gimp native batch convert? - by y2keeth - 06-08-2023, 04:19 AM
RE: gimp native batch convert? - by Ofnuts - 06-08-2023, 08:29 AM
RE: gimp native batch convert? - by y2keeth - 06-09-2023, 04:53 AM
RE: gimp native batch convert? - by Ofnuts - 06-09-2023, 08:10 AM
RE: gimp native batch convert? - by y2keeth - 06-10-2023, 03:46 AM
RE: gimp native batch convert? - by Ofnuts - 06-10-2023, 06:44 AM
RE: gimp native batch convert? - by y2keeth - 06-13-2023, 03:53 AM
RE: gimp native batch convert? - by y2keeth - 06-19-2023, 11:44 AM

Forum Jump: