dmpop/lilut
1
0
Fork
You've already forked lilut
0
Simple PHP-based web application for applying Hald CLUT presets to JPEG files https://dmpop.xyz/lilut
  • PHP 56.2%
  • CSS 29.2%
  • JavaScript 13.9%
  • Dockerfile 0.7%
2026年05月15日 13:49:42 +02:00
luts Close session before JSON response and strip file extensions in UI 2026年05月15日 11:22:13 +02:00
.gitignore Extract shared JS into script.js and log failed ImageMagick commands 2026年05月15日 11:06:20 +02:00
admin.php Add default password hashes as PHP constants 2026年05月15日 13:44:17 +02:00
AGENTS.md Add AGENTS.md with project architecture overview 2026年05月10日 13:03:37 +02:00
common.php Add default password hashes as PHP constants 2026年05月15日 13:44:17 +02:00
custom.ini Add Docker setup for PHP application with ImageMagick 2026年05月10日 12:48:31 +02:00
docker-compose.yml Add Docker setup for PHP application with ImageMagick 2026年05月10日 12:48:31 +02:00
Dockerfile Add Docker setup for PHP application with ImageMagick 2026年05月10日 12:48:31 +02:00
favicon.png Tweak logo 2023年02月22日 13:49:42 +01:00
favicon.svg Tweak logo 2023年02月22日 13:49:42 +01:00
index.php Add default password hashes as PHP constants 2026年05月15日 13:44:17 +02:00
LICENSE Major update 2023年02月03日 22:33:20 +01:00
README.md Update README to reflect multi-file architecture and dual password setup 2026年05月15日 13:49:42 +02:00
script.js Extract shared logic into common.php 2026年05月15日 13:34:42 +02:00
SECURITY.md Update project assets and add Docker support 2026年05月08日 11:40:35 +02:00
style.css Extract shared logic into common.php 2026年05月15日 13:34:42 +02:00

Lilut

Lilut is a simple PHP-based web tool for applying ready-made Hald CLUT presets to JPEG files.

Demo

Features

  • Drop or select a JPEG and apply all Hald CLUT presets at once
  • Select which LUTs to apply via the LUT panel — all selected by default
  • Adjustable intensity slider (0–100%)
  • Parallel ImageMagick processing with configurable pool size
  • Results grid with lazy-loaded thumbnails
  • Download individual images or all results as a ZIP
  • Password-protected downloads via bcrypt hash or environment variable
  • Admin page to upload and delete LUT presets
  • CSRF protection and rate limiting
  • Auto-orient for correct EXIF rotation on phone photos
  • Dark-themed responsive UI with drag-and-drop
  • Docker support with volume-mounted luts/

Architecture

Lilut is a no-framework PHP app. Shared backend logic lives in common.php, used by both index.php (main tool) and admin.php (LUT management). The frontend is a single script.js and style.css. Image processing uses the ImageMagick CLI (magick or convert), not php-imagick.

File Purpose
common.php Session, CSRF, password helpers, utility functions
index.php Main app: upload, LUT processing, results, downloads
admin.php Admin page: upload and delete LUT presets
script.js Password modal, drop zone, slider, LUT selection, download gates
style.css All styles (dark theme)

Dependencies

  • PHP
  • ImageMagick CLI (magick or convert command)
  • PHP Zip extension (for ZIP downloads)
  • Git (optional)
  • Docker (optional)

Installation

  1. Install the required packages on a local machine or a remote web server.
  2. Clone the project's repository using the git clone https://codeberg.org/dmpop/lilut.git command. Alternatively, download the latest source code using the appropriate button on the project's pages.
  3. Put Hald CLUT files (.png) into the luts/ directory.

To run Lilut locally, switch to the lilut directory in the terminal and run the php -S 0.0.0.0:8000 command, then point your browser to http://127.0.0.1:8000.

To install Lilut on a web server with PHP, copy the lilut directory to the document root of your server. Make sure the upload/ and results/ directories are writable by the web server.

Deployment with Docker

The project includes a Dockerfile and docker-compose.yml for containerized deployment.

  1. Install Docker and Docker Compose.
  2. Clone the repository: git clone https://codeberg.org/dmpop/lilut.git && cd lilut
  3. Put your Hald CLUT .png files into the luts/ directory.
  4. Run docker compose up --build to build the image and start the container.
  5. Open http://localhost:8080 in your browser.

The luts/ directory is mounted as a volume inside the container, so you can add or remove presets without rebuilding. The upload/ and results/ directories are auto-created at build time with correct permissions (www-data). The container runs under the www-data user.

Alternatively, build and run the container manually:

docker build -t lilut .
docker run -d -p 8080:80 -v ./luts:/var/www/html/luts --restart unless-stopped --name lilut lilut

Open http://localhost:8080.

Usage

Open index.php in a browser. Drop or select a JPEG file, adjust intensity, then click Apply LUTs. By default every LUT in the luts/ directory is applied. Use the LUTs panel to select specific presets and the Download all as ZIP button to download all results at once. Click individual thumbnails to download single images.

Use the Clear results button to remove all generated results from the server.

Password protection

Download and admin access are password-protected by default (password: secret). The two passwords are independent and can be configured separately.

Via environment variable

Set the environment variables to bcrypt hashes:

export LILUT_PASSWORD_HASH='2ドルy12ドル$...' # download password
export LILUT_ADMIN_PASSWORD_HASH='2ドルy12ドル$...' # admin password

In Docker, pass them via docker-compose.yml:

services:lilut:environment:- LILUT_PASSWORD_HASH=2ドルy12ドル$...- LILUT_ADMIN_PASSWORD_HASH=2ドルy12ドル$...

Via source file

  1. Generate a hash: php -r "echo password_hash('your-password', PASSWORD_DEFAULT);"
  2. Replace the constant in the respective file:
    • index.phpLILUT_DOWNLOAD_PASSWORD_HASH (download password)
    • admin.phpLILUT_ADMIN_PASSWORD_HASH (admin password)

If an environment variable is set, it takes precedence over the hardcoded constant.

Admin page

Open admin.php in a browser to manage Hald CLUT presets:

  • Upload — drop or select a .png file to add it to the luts/ directory.
  • Delete — remove a LUT file from the luts/ directory using the delete button next to each entry.

Upload and delete actions are protected by an admin password (default: secret), independent from the download password. Set it via the LILUT_ADMIN_PASSWORD_HASH environment variable or by editing LILUT_ADMIN_PASSWORD_HASH in admin.php — see the Password protection section above.

Problems?

Please report bugs and issues in the Issues section.

Contribute

If you've found a bug or have a suggestion for improvement, open an issue in the Issues section.

To add a new feature or fix issues yourself, follow the following steps.

  1. Fork the project's repository.
  2. Create a feature branch using the git checkout -b new-feature command.
  3. Add your new feature or fix bugs and run the git commit -am 'Add a new feature' command to commit changes.
  4. Push changes using the git push origin new-feature command.
  5. Submit a pull request.

Author

Dmitri Popov me@dmpop.xyz

License

The GNU General Public License version 3