Spectral film simulations in ART

Thanks no rush…I just found python as installed by uv I think…:slight_smile:

This is what I keep getting…must be something silly on my part…

Its also not 1.23 its the latest nightly but I missed changing the folder name on install…

Hi, I managed to make it work on windows with uv with the following command string inside the json:

{"ART-lut3d" : {
    "command" : "c:\\users\\User\\.local\\bin\\uv.exe run --python 3.11 --with-requirements w:\\agx-emulsion\\requirements.txt --no-project --with-editable w:\\agx-emulsion agx_emulsion_mklut.py --server",

where c:\\users\\User is the path to your user directory, and w:\\agx-emulsion is the path where you installed AgX. In both cases, note the double backslash.

HTH

You are so kind as always…thanks I would have never used the double backslash and come up with that command line… You are always so generous with your time…Thank you

On Linux, for the moment I’m stuck with the python install. I have Python 3.13 installed on my distro (Manjaro) and when I try to install the virtual environment Python for agx-emulsion, it sees that I already have some packages installed (such as numpy), but the version installed is too recent. I’ll have to figure out how I can enforce the virtual environment to install what agx-emulsion requires.
By the way, when I tried on MacOS, I found out that python 3.13 is also too recent, I had to install python 3.11 to make it work (but I don’t really know how to deal with python in general).

Hi,
I suggest to install python 3.11 and use a “clean” virtualenv. one simple way is to download one of the python standalone builds from GitHub - astral-sh/python-build-standalone: Produce redistributable builds of Python and create a virtualenv with that version. Then it should work. Or you can also try uv.

HTH

1 Like

Just a random comment (and I’m not at my computer to test) but in some contexts over the years it’s been possible to use single forward slashes in Windows paths instead of double back slashes. For example, while command.com didn’t accept forward slashes (not sure about cmd.exe), the OS would accept them directly and they were often simpler to deal with in code.

Possibly another option.

1 Like

So, on Manjaro I tried uv, then Miniconda… both failed to install agx_emulsion for different reasons. Actually Miniconda seemed to succeed in the installation, but launching the GUI failed with some error about pyqt that I couldn’t solve.
Then using the standalone build you linked above, I was able to install it. Launching the GUI works, and I can manipulate an image from the GUI.
Then I proceeded to set it up in ART, and I could load the LUT but then ART fails manipulating the image, showing some message in the GUI about “invalid parameters”. In the console output I see this message:

computing 3dlut for /home/sguyader/Pictures/LUTs/ART_agx_film.json
extlut - exec server error for /home/sguyader/Pictures/LUTs/ART_agx_film.json

Any idea?

Hi,
Can you show me how you run the gui and the contents of your ART_agx_film.json file?

I think my mistake was that I was the virtual environment installed python3.13, and I have something wrong with my python 3.11 install. I’ll try again.

1 Like

I get “illegal instruction (core dumped)” when I try to use the standalone python install from “astral-sh” repo. I’ll stop here for today.

FYI I’ve added an option for color mode in the Film Grain tool, and I’ve significantly reworked the algorithm to make it more credible (to my eyes at least).

1 Like

Thank you very much for your work on this.
However, I am failing to make this work as well.

I have tried a couple of things:

  • Using python venv to install agx-emulsion (which worked fine for running the GUI)
  • Using uv (also launches the GUI OK)

However, I’m not able to run in with ART 9069c2a. It either returns ART_agx_film.json ‘Invalid LUT parameters’, or a hard crash.

I have tried both uv and venv methods, with similar results. Also both the CLUT folder way and the Color Correction way.

Running Windows 11. Here’s the current JSON line:

    "command" : "c:\\users\\<removed user name>\\.local\\bin\\uv.exe run --python 3.11 --with-requirements c:\\agx-emulsion-main\\requirements.txt --no-project --with-editable c:\\agx-emulsion-main agx_emulsion_mklut.py --server",

Thank you for your work, hopefully this helps fix the issue for others in the thread as well.
Regards,

Hi, can you try your “hard crashing” configuration with the latest nightly? https://github.com/artpixls/ART/releases/download/nightly/ART_80bde92_Win64.exe
There was a bug causing a crash when you set the clut cache size to 0, which should be fixed now. (I would still recommend to increase the cache size to at least 10 for everyday use, but regardless the new build should not crash).

Confirming that it now works as intended. Thank you very much!

1 Like

Very cool, thanks for the heads up!

Hi,

I managed to install and run agx-emulsion with ART 80dbe92 and uv on Windows. So I tried to run it the same way on Ubuntu, but failed.
I’m not sure, but I think the reason is that ART can’t recognise the agx_emulsion_mklut.py start command with uv in ART_agx_film.json on Linux.

On Ubuntu, I arranged the “command” line in ART_agx_film.json as follows.

"command" : "uv run --python 3.11 --with-requirements ~/.config/ART/LUTs/agx-emulsion/requirements.txt --no-project --with-editable ~/.config/ART/LUTs/agx-emulsion agx_emulsion_mklut.py -server",

And when I enter this command directly from the terminal, it seems to start normally and no error messages are found. However, from ART, when I select ART_agx_film.json as LUT, I get the error message “invalid LUT parameters for: ART_agx_film.json”.

I assume that the command itself is correct, but the command line on the json file is not recognised by ART on Ubuntu.

Thank you for your attention.
Regards,

Hi, try expanding the ~ to your actual home directory (e.g. /home/yasuo or something like that). The expansion of ~ is performed by your shell, and ART doesn’t use it, so it will look for a directory called ~ instead.

EDIT: also, it’s --server, not -server

HTH

It seems that having this enabled (under film simulation) causes the image to differ based on your selected “output color space”.

The original rawtherapee documentation says this should never happen, however the ART documentation does not make a mention of it. I do not know if this is intended behaviour (presumably its because agx_emulsion is reading the ‘output color space’ and emitting results accordingly), but it did confuse me initially as I was not a regular user of ART and couldn’t tell if my color management was working correctly.

Good work however, I have enjoyed using this. I would also love if the other features such as halation and grain/softness/im not sure the exact cause of the effect are added. These features have made me seriously consider using ART more often!

Thank you very much! It works!

1 Like

Hi,

Changing the output color space can indeed have an impact on your output in some case. In fact, I would say it should, and I would be more suspicious of the contrary.
However:

  1. This is not related to agx_emulsion, but to the ART pipeline in general (in other words, you should be able to observe the same effect without using agx_emulsion at all)
  2. It should only affect some images with colours that are close to (or exceeding) the gamut boundaries of some of the colour spaces involved (input, working, output, and display). So it should not happen with all pictures, and it actually should not be visible much on most pictures.

If you can share one example showing this behaviour, I can try to be more precise about what is going on (and double check that you did not uncover a bug instead).

Adding the grain and halation algorithms from agx_emulsion would be quite challenging for technical reasons. However, ART has its own version of both. Probably not as good/accurate, but maybe worth a try?

HTH