Hey, I was thinking about possibilities of getting proper output sharpening for downscaled images, mainly for web use, and was wondering if there ever were any talks about possibly including a scale module? Something that would allow me to lets say set a 1000px long side in a module near the end of the pipeline, then I could add a sharpening module on top of that, and then a framing module, and then export the image. In my mind it would be useful for web posting, I read about people using some Lua scripts for that but to me that feels quite clumsy, and if I understand it correctly it doesnt really allow for a “wysiwyg” sort of workflow.
What about exporting at the final size in TIFF/PNG, reimporting, and applying sharpening and/or frame?
Yeah, that is always an option, though looking at it from this point, I could probably just use the full size export, open that in gimp or a similiar tool directly, so no library mess would be involved (also I would have more direct control over the resize algo), resize and add a frame there… I think that my idea would solve the “issue” without needing to leave the darkroom view.
Yall know that I am not the biggest fan of AI use, but I tried to Claude my way out of this - and found out that while this idea works, it is painfully slow on lower-end hardware with modules like Spektrafilm… I basically run the Spektrafilm module all the time, and because we want to downscale the image later in the pipeline, you need the full size processed image as the input, to properly see what you will get, therefore you are essentially running the high quality processing toggle on once you add the module. And I am not sure if this has a different solution.
For anyone interested - here is the module file:
resize.zip (3.5 KB)
copy it to /src/iop, then add the resize option into all the module order entries, I did that with this command:
cd ~/src/darktable
sed -i -e '183,${' -e '/"borders", 0/i\ { {75.5f }, "resize", 0},' -e '}' src/common/iop_order.c
sed -i '176i\ { {67.5f }, "resize", 0},' src/common/iop_order.c
then rebuild, though it is a bit borked - for example if you have a style with a custom module order, the search wont show you the new “resize” module, you need to switch to one of the base module orders, and on the mentioned lower-end hardware, weird strech/graphical glitches occur while it loads…
"it is painfully slow on lower-end hardware with modules like Spektrafilm… I basically run the Spektrafilm module all the time, and because we want to downscale the image later in the pipeline, you need the full size processed image as the input, to properly see what you will get, therefore you are essentially running the high quality processing toggle on once you add the module. "
Sure, but why do this? You have already done all your processing on the first darktable run so after exporting at full size and then re-importing you only need the sharpening module active for that, having a second pass of spectrafilm and other stuff sounds like self inflicted pain - unless you have really high end hardware to run it on.
Yeah, sometimes I do not render the full size image, sometimes I only want a web-version. On my main workstation I do have the power to run this fine. Anyway, it all comes down to me having ideas about how I want things to work, I guess I still cant shake the old Photoshop workflow completely (where I had an image done, and with one action I would get a full sized export, then a preview window of the scaling menu would pop up, where I could choose the scaling algo, then a sharpening menu would pop up, where I immediately saw how the smaller sharpened image would look, border was added and the web ready image saved alongside), and you know, it never hurts to ask.
Hi @bazdesh! @piratenpanda created such a module already after I requested it for use with the Spektrafilm module. But seemingly, as I expected, it got buried in the Spektrafilm for darktable module thread.
I collected all posts about its development in this post. Perhaps a mod can break out my listed posts to a separate resize module thread?
Really hoping that it can show up in the next stable darktable release, as it is needed for the Spektrafilm module to work as intended. ![]()
![]()
Ah cool! Yeah, I definitely didnt see this one. From the screenshot it looks like the same idea as the patch I got - mine gives you a target pixel value, choice for long/short side, and the re-sampling method. (I also thought about the upsampling possibility, though it was not a target at first - the slider can go up to 65k pixels)
Hows the performance on the one Benjamin made? I would guess that it would struggle in a similiar way just because the whole image needs to be processed, but also I have 0 skills here, so… ![]()
He implemented an option in the module to apply the resizing at export only. So, performance when editing is not an issue.
With this option turned off I still think it was quite snappy on my 6700 XT.
Yeah, that would work! I didnt really think about that though because it - in my mind - would break the purpose of getting the exact smaller image for the sharpening purpose. But I guess that it is useful anyway, I can just have the “only resize for export” bit checked while I apply the downscaler, to save the computing power, prepare the post-resize sharpening and frame and then when I need to do the actual output wysiwyg bit, I just uncheck it, so the image gets processed fully, and then I can export.
So I guess in your low-mpx workflow youve got two instances running, one upscales the image pre spektrafilm to get the grain and details, one post spektra to get back to a “real” resolution?
/edit: also just found out that the patch I posted doesnt properly work when upscaling, didnt test that before ![]()