Code Monkey home page Code Monkey logo

jxl-batch-converter's Introduction

JXL Batch Converter

A simple GUI for libjxl binaries, written in C++ with Qt.

Or I could say a glorified batch command wrapped in GUI... :3

Screnshot

(new in v0.3+) Drag and drop files / folder directly! Screnshot-DragNDrop

Currently tested on Windows 10 and WSL2 Ubuntu.

Features:

  • cjxl, djxl, cjpegli, and djpegli
  • Basic encoding parameters GUI
  • Custom flags
  • Single / multiple file mode
  • Folder with / without recursive mode
  • Set per-image processing timeout
  • Options saved on exit (config file will be placed in user home)
  • Multi-threading support (v0.4.0+)
  • Copy file on encoding error (v0.4.0+)
  • Keep original date and time (v0.4.2+)
  • Delete input files after successful conversion (v0.5.0+)
  • Exclude folders while in Input folder mode (v0.5.0+)
  • Add suffix to output file (v0.5.0+) with some extra options:
    • Use %rnd% to generate 4 alphanumeric random string that's unique per conversion batch
    • Use %hash% to generate 6 alphanumeric simple hash string that's unique per encoding parameters and save the parameters into .txt file in the output folder, this can be useful for tracking the parameters used for the specific hash (v0.5.2+)

Notes on multi-threading:

  • While doing recursive folder processing, it can sometimes trigger a failure when the tool is creating a new folder. If you managed to get this error, just rerun the tool again (make sure to disable Overwrite!). Should be fixed but I'll put this warning just in case it still triggers.

Get libjxl binaries at the official project page!

Few tips and tricks

- Batch file a folder and all subfolders

  1. Select Input folder tab on File IO section
  2. Select your source folder and output folder
  3. Enable Recursive (scan all subfolders) option

- Separate encoding parameters for specific file extensions

"I want to use X params for jpeg, but I want Y params for png!". Here's how you can do:

  1. Select Input folder tab on File IO section
  2. Make sure to have Overwrite if file already exists option on output disabled
  3. Enable Override extensions option and add your preferred extension to use for first encoding parameters (eg. jpg)
  4. Set your preferred parameters on Encoding options
  5. Press Convert
  6. Once done, repeat steps 3-5

jxl-batch-converter's People

Contributors

kampidh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

wazbat

jxl-batch-converter's Issues

A few suggestions on how to make the converter even better

Add option "Save to the same folder as the original". Specifying it manually every time is not very convenient.

Add option "Delete original", and the choice - to the Recycle or in the usual way. There should also be a fairly reliable verification of the success of the conversion, preferably based on several parameters:

  1. Report from the codec about success.
  2. Checking the existence of the new file.
  3. Check if the file size is 0 (I have encountered similar cases several times when using other converters and other file formats).
  4. Ideally, it would not be superfluous to check the validity using a special tool (I don’t know which one). Or try decoding with the same codec.

Need to add an icon for the program.

Add option "Clear the list of files after successful conversion".

Add button "Remove all files from list". Currently, such a button remove only the selected files, which is quite strange, since usually need to delete the entire list.

Disadvantage: if the "multi-threading" option is selected, then at the end of the process not displayed: total size of incoming files, files after conversion, and the difference in percentage. More precisely, it is displayed only for each thread separately. Of course, need the sum of all the numbers.

Add the option "If a file with the same name already exists, then add a number to the new file". It is also advisable to provide for the situation where, for example, the file "file-1.jxl" already exists, so that the converter creates the file "file-2.jxl" rather than "file-1-1.jxl". Or, better, instead of a number, an identifier and some random set of characters, for example “file-#double-H7u3.jxl”. The identifier makes it easy to find these files and rename them in the desired way - manually or automatically using one of the specialized programs.

Make sure that the program version is displayed in the "About" tab.

P.S. Sorry for bad English, I have to use Google translator.

It is not possible to convert files whose name or path contains non-ASCII characters

This is a long-standing and considerable problem. I've been looking for a long time for program that can handle these characters and I know that the reason is in the JXL encoder, since its creators lack the skill or desire to fix it.

However, the solution is actually quite simple. Just need to add code that will analyze the name + path and, if it detects non-ASCII characters, it will copy the file to a temporary folder on the same disk, changing the name to a “safe” one, for example, “file”, converting, then moves the result to the original folder and restores the original name. I don’t know why no one has done this before.

What do you think about it? Can you provide your converter with this functionality?

Strange and unpredictable program behavior

First, I’ll say thank you for taking into account the wishes last time and improving the converter.

So, I decided to test the new functions and this is what happened, I’ll tell you in order:

  1. I added a folder with several PNG files, activated the option "use the same folder for output". Started the process. Now the folder contains the same files in JXL format.

  2. Without changing anything, I started the process again. The converter skipped all the files, reporting that they already existed.

  3. Now again, but with the "Output file suffix" option activated, I wrote "%rnd%" in the input field. As a result, I received files like "file-123456.jxl". Here I immediately had several comments:

A) "%rnd%" you'd better add to the corresponding input text field so that it is the default and also as an example. Otherwise, most users probably won't even know about this feature.

B) "%rnd%" already contains "-". I think it would be better if this thing generated only random characters, without the "-". And the input field will contain "-%rnd%" by default. This way, those who prefer "_" can use it by simply editing it to "_%rnd%" or whatever.

C) With some surprise, I discovered that the sequence of characters is not generated every time for each file, but is the same for the conversion session. In general this is not important, it just seems to me that the point of making it unique is to make it truly unique - that is, for each file.

D) It is advisable to add a setting for the length of the sequence of characters 4-8, for example "%rnd4%" will create 4 characters, and "%rnd8%" - accordingly 8. Probably, 4 characters will be enough for most users. (However, you can safely ignore this, I just tend to notice flaws and like to finish everything to the ideal).

  1. I launched it again, the process went as expected, creating several files with a different set of characters.

  2. I disabled the "Output file suffix" option and ran it again. The program should have skipped existing files (which were created during the first conversion), but instead I saw something like "file-%rnd%.jxl" in the folder. This is definitely a bug.

  3. One more time. Now the program reported that files with the same name (with the suffix "-%rnd%.jxl") already exist and skipped them.

Save xmp data

I have jxl image with integrated xmp data inside (lightroom). After conversioning jxl to jpg this data (editions history, keywords, faces and e.t.c. is gone).

For example image with face data (jxl and decoded jpg)
image.zip

Original jxl have next integrated xmp data
image

Converted to jpg do not have xmp inside.

Is it possible to save integrated xmp data?

Mac os support

Is it possible to add mac os support?
Have m1 air, can help with it

Output folders structure

It would be great to have an option that would create the same folder and subfolder structure as input

Multithreading

If have many images and cpu with many cores it is will by grate have option to load cpu 100% converting images not one by one but multiple
Снимок экрана 2024-01-11 090458

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.