06-10-2024, 03:14 PM (This post was last modified: 06-10-2024, 03:15 PM by misha.physics.)
Hi. I'm trying to do something that seems pretty simple, but I'm not sure if it's possible to do in GIMP at all, but I really hope so.
I have an image "file.jpg". I open it with GIMP, then I go to "File", then "Export As...", I choose "DDS image" (there're two ones, I select the first one, I don't know if/how they differ from each other). Then I use the settiongs (I choose the compression - BC1/DXT1, other options are default):
(Sorry, my picture isn't vissible. It's on https://imgbox.com/YVoUTMfS)
After exporting I get "file.dds" picture.
So, I have a directory which contains several subdirectories each of which contains several *.jpg pictures similar to "file.jpg" (all picture are 512x512, but I think it doesn't matter). All what I need is to export all these *.jpg images to *.dds format ang get the results the same as if they were received if I exported them manually one by one as I've written above. The all exported *.dds file should have names the same as its input *.jpg files. Also, it would be nice to delete all input *.jpg files after conversion.
I've seen some scripts for GIMP, but they look pretty difficult for me, I've never used GIMP before. Maybe there's a simple way to do it in Windows command-line CMD. (Also, I could make such conversion on Linux if it will be easier, than on Windows, although my laptop with Linux isn't so powerful). Also, I've installed BIMP and tried the "Batch Image Manipulation Plugin", but I havent found the *.dds format for exporting...
Thanks. I've installed that and converted my JPG to DDS. The only thing is that I get the DDS image which has the size 256 KB, whereas converting the same JPG image using GIMP (or Photoshot) gives the DDS image of size 128 KB. It's a problem, since I have many such DDS images, so I'm losing half of my disk space. I don't see any parameters for the output DDS file in XnConvert.
Just a note about BIMP. The code does contain reserved words, such as save so you will not find file_save_dds in the BIMP PDB listing. A common workaround is put the command in a simple script/plugin wrapper and call that from BIMP (the GIMP other procedure option).
I tried always yesterday and while said simple (python) plugin works on its own, when used in BIMP it just outputs the input jpeg file. If you can write a script-fu scm then you stand more chance using the Gimp batch format.
see: https://www.gimp.org/tutorials/Basic_Batch
06-11-2024, 08:11 PM (This post was last modified: 06-11-2024, 08:15 PM by rich2005.)
(06-11-2024, 12:24 PM)misha.physics Wrote: Thanks, I've tried ImageMagick a lot before started this thread. The problem with IM is that it converts my JPG to
DDS differently than GIMP.
For now XnConvert is the best way, but it gives DXT5 compression instead of DXT1 for a DDS.
It is a shame that IM does not give a result.
For a DXT1 format then back to Gimp, and BIMP but it is hedged with ifs and buts...
This is the "shell" plugin I use with BIMP, I am no coder so it is very basic.
Unzip the attached and put for_bimp.py in your plugins folder
Starting BIMP it looks like this:
(1) Is the folder of jpg's
(2) The is the "Other Gimp procedure" option when you click on "Add"
(3) Search for bimp and Ok it.
(4) Set a "scrap" folder. BIMP will write jpegs there regardless. You can clean up afterwards.
Now for the if-n-buts
The plugin will write .dds files in DXT1 format but the filename is in the form name.jpg.dds Easy for me in linux to bulk rename and get rid of the .jpg bit. I do not know about Windows.
The plugin writes the .dds files to your User folder C:\Users\your_id\ Recover them from there. Very tedious but maybe better than one-at-a-time
If you want to change the parameters, then look up file_dds_save in Help -> Procedure browser and compare with the line in the plugin.