Sorry for my late reply, but after finishing the project I was on vacation, so no chance to reply earlier. But the good news is: The project was finished in time, and this is also due to your help. A big thank you therefore goes to all that replied and helped with hints, advice and code! I learned a lot during the project, and I will try to describe my final workflow, obstacles and solutions so that you and others can avoid my mistakes .
The Reproduction
After working a lot with the original photographs of the paintings, which had issues with uneven lighting and high ISO noise, I decided that I want to scan the pictures myself on a flatbed scanner to have better source material. After getting the original paintings, I discovered that they (~25 paintings) come in all different sizes and paper colours. The sizes were mostly above A3, and I only own an A4 scanner, so that I had to use a camera for reproduction. The original photographs showed only 2 background colours (yellow and white), but I got at least 10 different paper colours. The auto white balance of the first photographs obviously got rid of most of the paper colour differences, but it changed crayon colours as well, such that I decided to use a fix white balance and use my colour checker target to get a good colour reproduction.
I used a flash pointing towards a white ceiling, set strong enough to overpower natural light, to get an even light distribution. The paintings were located on the floor, with my camera on the tripod facing downwards. Unfortunately, I did not have enough time for a proper setup, so I forgot to remove a moving box (we still have some to unpack from moving to this house) on the right of the area where the paintings were located, such that I got a slight brightness gradient on the right of all images. Eventually I lived with that and tried to remove it with an inverse gradient in post, but it made later processing times fail some times, such that I highly recommend to get the source image as good as possible. Next time I would shoot them again instead of fixing it in post, but the impact was varying a lot among the images, such that I first discovered it after finishing 6 or so images already.
The Raw Development
Only basic adjustments in darktable: Getting the exposure fixed, and cropping to the actual painting (some did not use the entire paper, others were painting over the edge which caused other trouble …).
Additionally, I used the perspective correction module of darktable to get the paper straight. There was not much distortion as the camera was almost parallel, but it helped rotating the image and getting rid of the little distortion that was still there. It helped that the floor colour (background) was different to the paper colour such that the module easily found straight edges in the image. I just had to remove false positives. This module is incredible, if you did not use it so far, make sure to check it out!
Background Removal & The Final Touch
I ended up using @Iain’s extremely useful G’MIC script in GIMP. It did not work all the time, mostly due to uneven lighting (the gradient I already mentioned). So, I ended up processing different parts of the picture with different setting, blending them softly afterwards, or using other techniques to make it work.
This step was followed by a tone curve to improve contrast and make the background really white (and remove any remaining colour cast which was not properly removed). The background had to end up as [255, 255, 255] in the exported jpeg, which introduced additional difficulties, especially with extremely lightly painted details (but important to the image) and white/gray parts (painted on yellow background).
For the lightly painted details, there was no general solution. Most of the time I separated these and used additional tone curve operations and/or erode/dilate steps to improve the appearance, or did the background removal for these with different parameters.
The white/grey parts were not so easy to separate, and differed among the pictures (only approx. 5 pictures used white/grey colour at all). I ended up using an individual multi-step curve/inverse/lin<->log/desaturate combination to separate the grey strokes to a separate layer above the other parts.
Last steps have been to crop the image to square format, check the white of the background (by using a very steep curve that exaggerates all non-white image parts. Any idea how this could be implemented as a check layer?), and rework if necessary.
What I really missed, besides a check layer implementation of my really white check, were non-destructive workflows for operations such as curve, inverse, desaturate, such that mistakes would not require to start from scratch. I hope, GIMP gets there soon .
Final Thaughts
Hm, I have to learn to say “no”. This project took about 15 to 25 hours, plus your time. But seriously, I would do it again, it has been for a good cause, and it had been fun. The kindergartners got mugs with the pictures (the children painted the kindergartners) at their year-end as an additional thank-you which they for sure deserve. In my opinion, they are doing one of the most important jobs in the world, as they are the ones who are shaping the world’s future (not us silly engineers and scientists, I hope you understand what I mean ). And they are (at least here) not paid the corresponding counter value. So I am really happy that this worked out well. A big THANK YOU again to all of you who helped!