d2f2 is a tool written in Python to convert image folders into files.
You can install (and update) d2f2 from PyPI via the command line
pip install d2f2 -U
or use one of the standalone versions (see below).
d2f2 offers two modes of operation: "single" and "batch".
The standard mode, converts each given directory into a file.
d2f2 /a/path /another/path ...
Useful for converting big batches of folders, this mode converts each subdirectory within the given directories into a file. To use it, add the -b/--batch option to the command:
d2f2 -b /a/path /another/path ...
By default, d2f2 saves files in the PDF format. If you want to use another supported format, use the -f/--format option:
d2f2 /a/path ... -f FORMAT
Currently, there are 2 supported formats (with more to be added in the future). Use the appropriate format as the FORMAT parameter:
- [PDF] - Portable Document Format (default)
- [CBZ] - Comic Book Format, ZIP-compressed
By standard, d2f2 saves files to the current directory. If you want another output path, use the -o/--output option:
d2f2 /a/path ... -o /an/output/path
By default, d2f2 sorts the images in alphanumeric, ascending order (A-Z). If you want to use another sorting mode you can specify one by using the -s/--sort option:
d2f2 /a/path ... -s MODE
Currently, there are 6 sorting modes available. Use the corresponding number from the following list as the MODE parameter:
- [ 1] Alphanumeric, ascending (default)
- [-1] Alphanumeric, descending
- [ 2] Last time modified, oldest first
- [-2] Last time modified, newest first
- [ 3] Time of creation / metadata change, oldest first
- [-3] Time of creation / metadata change, newest first
d2f2 offers an interactive shell including all functions of the normal d2f2 CLI tool.
Standalone versions for the shell are available for Windows and Linux (see Releases)
You can also start the shell from the command line:
d2f2 --shell
- More output formats (EPUB, MOBI)
- Custom order for images
- Modify names of output files
- Standalone GUI client
This tool uses the PyMuPDF library, which provides the core functionality of inserting images into PDF files. According to its licensing terms, this project is released under the AGPLv3 license (for more information, see LICENSE)