scaling down to 120x90px Gray with less ringing
Posted: 2019-09-14T17:41:51-07:00
I'm training a TensorFlow model to recognize some natural objects. To generate the training data, I'm taking lots of pictures with a pretty good camera at 4000x3000 px resolution, full color. I need to scale these down to 120x90 px 8-bit grayscale. I'm using ImageMagick 6.9.7 on Linux.
"convert -resize 120x90" works well, but there are some ringing artifacts around sharp edges. I've tried this instead (found it on a forum somewhere after a Google search):
It's perhaps a little better, but there is still some ringing. See here:
There's still pretty obvious ringing around the person and the telegraph pole.
Is there a better way? Can I reduce ringing even further?
The goal is to create tiny images as close as possible to the "look" of the originals (while discarding lots of resolution and all of color data). The neural network will learn how the world looks like from these images, and I don't want to train it with ringing artifacts.
"convert -resize 120x90" works well, but there are some ringing artifacts around sharp edges. I've tried this instead (found it on a forum somewhere after a Google search):
Code: Select all
find images/original/* | cut -d / -f 3 | parallel \
convert images/original/{} -colorspace RGB +sigmoidal-contrast 6.5,50% \
-filter Lanczos -distort resize 120x90 \
-sigmoidal-contrast 6.5,50% -colorspace Gray images/small/{}.png
There's still pretty obvious ringing around the person and the telegraph pole.
Is there a better way? Can I reduce ringing even further?
The goal is to create tiny images as close as possible to the "look" of the originals (while discarding lots of resolution and all of color data). The neural network will learn how the world looks like from these images, and I don't want to train it with ringing artifacts.