Converting from JPG to RGB adds lots of black pixels. What I want is each black pixel to be an 'average' of the nearby pixels, except other black ones. The intention is to use the RGB for further mathematical manipulation, and my cameras all produce JPGs.
Replacement of the black with a single colour is easy:
Code: Select all
convert a.jpg -size 2000x3000 -depth 32 b.rgb
convert -size 2000x3000 -depth 32 b.rgb fill white -opaque black -size 2000x3000 -depth 32 c.rgb
-adaptive-blur looks potentially useful, but does not know how to ignore the nearby black pixels; and, if the pixel is not black, then I'd rather not blur it.
Masking looks like a way to go, but I cannot figure out the details. Any ideas welcome, thank you.
RigTig