lua module not found

DT 3.0.2 I’m trying to install WP Fergusson post sharpening lua/imagemagick.

I’m trying NOT to follow the instructions. I try to have everything local.


require "/home/froggy/.config/darktable/lua/post-sharpen.lua"

when I start dt I get:

darktable -d lua
(gtk warings removed)

2.570842 LUA ERROR : /home/froggy/.config/darktable/luarc:1: module '/home/froggy/.config/darktable/lua/post-sharpen.lua' not found:
        no field package.preload['/home/froggy/.config/darktable/lua/post-sharpen.lua']
        no file '/usr/share/lua/5.3//home/froggy//config/darktable/lua/post-sharpen/lua.lua'
        no file '/usr/share/lua/5.3//home/froggy//config/darktable/lua/post-sharpen/lua/init.lua'
        no file '/usr/lib/lua/5.3//home/froggy//config/darktable/lua/post-sharpen/lua.lua'
        no file '/usr/lib/lua/5.3//home/froggy//config/darktable/lua/post-sharpen/lua/init.lua'
        no file './/home/froggy//config/darktable/lua/post-sharpen/lua.lua'
        no file './/home/froggy//config/darktable/lua/post-sharpen/lua/init.lua'
        no file '/usr/share/darktable/lua//home/froggy//config/darktable/lua/post-sharpen/lua.lua'
        no file '/home/froggy/.config/darktable/lua//home/froggy//config/darktable/lua/post-sharpen/lua.lua'
        no file '/usr/lib/lua/5.3//home/froggy//config/darktable/lua/post-sharpen/'
        no file '/usr/lib/lua/5.3/'
        no file './/home/froggy//config/darktable/lua/post-sharpen/'
        no file '/usr/lib/lua/5.3//home/froggy/.so'
        no file '/usr/lib/lua/5.3/'
        no file './/home/froggy/.so'

and the post-sharpen.lua file is there

ls -alF /home/froggy/.config/darktable/lua/post-sharpen.lua
-rw-r--r-- 1 froggy froggy 25822 May 24 11:56 /home/froggy/.config/darktable/lua/post-sharpen.lua

How can I fix this?


Try making the path in your luarc file relative:

require lua/post-sharpen.lua

1 Like


If you follow the instructions, everything will be local on your machine.

It did thanks.

The module is very useful, but is there some way of making a range instead of a fixed value?

Right now, I do it 1 at a time, since we can preview the effect, it’s trial and error process…

Thank you

There’s not really a way to do a range. There are a couple of presets supplied, one for web images based on 72 dpi and one for print based on 300 dpi. You could also export an image with no sharpening, then import it into gimp and play with the sharpening to find good parameters.

I created my own preset but setting the radius to 0 which imagemagick will calculate based on sigma.

My struggle is with the threshold, so I export a “whole bunch” to find the better one. The problem is that is per image, that’s why I wanted some kind of range.

Thank you for the excellent work. Now I don’t have to run a bash batch…

The article I referenced when I wrote the code is here. The threshold number is actually divided by 100 before being applied, so a value of 10 is actually .1