- PHP 56.2%
- CSS 29.2%
- JavaScript 13.9%
- Dockerfile 0.7%
Lilut
Lilut is a simple PHP-based web tool for applying ready-made Hald CLUT presets to JPEG files.
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 (
magickorconvertcommand) - PHP Zip extension (for ZIP downloads)
- Git (optional)
- Docker (optional)
Installation
- Install the required packages on a local machine or a remote web server.
- Clone the project's repository using the
git clone https://codeberg.org/dmpop/lilut.gitcommand. Alternatively, download the latest source code using the appropriate button on the project's pages. - Put Hald CLUT files (
.png) into theluts/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.
- Install Docker and Docker Compose.
- Clone the repository:
git clone https://codeberg.org/dmpop/lilut.git && cd lilut - Put your Hald CLUT
.pngfiles into theluts/directory. - Run
docker compose up --buildto build the image and start the container. - Open
http://localhost:8080in 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
- Generate a hash:
php -r "echo password_hash('your-password', PASSWORD_DEFAULT);" - Replace the constant in the respective file:
index.php—LILUT_DOWNLOAD_PASSWORD_HASH(download password)admin.php—LILUT_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
.pngfile to add it to theluts/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.
- Fork the project's repository.
- Create a feature branch using the
git checkout -b new-featurecommand. - Add your new feature or fix bugs and run the
git commit -am 'Add a new feature'command to commit changes. - Push changes using the
git push origin new-featurecommand. - Submit a pull request.
Author
Dmitri Popov me@dmpop.xyz