Page 1 of 1

remove odd pixels in the image

Posted: 2014-11-26T00:06:07-07:00
by nagarwal
I have a mortar image and it has some blackish pixels on the inside edges.
Image

I need to make those blackish pixels colored same as the grey mortar color.

Re: remove odd pixels in the image

Posted: 2014-11-26T00:26:01-07:00
by fmw42
try

Code: Select all

convert mn1-bRxR3LFR.png -fuzz 55% -alpha off -fill "rgb(230,230,230)" -opaque "rgb(63,63,63)" -alpha on show:

Re: remove odd pixels in the image

Posted: 2014-11-26T01:22:37-07:00
by nagarwal
fmw42 wrote:try

Code: Select all

convert mn1-bRxR3LFR.png -fuzz 55% -alpha off -fill "rgb(230,230,230)" -opaque "rgb(63,63,63)" -alpha on show:

I only needed to change those blackish pixels on inside edges but it changes the images a lot and looses the original texture. the result is

Image

Re: remove odd pixels in the image

Posted: 2014-11-26T01:26:13-07:00
by nagarwal
Is there a way to change all pixels with rgb(50,50,50) and less to rgb(230,230,230)? I think that can solve the problem.

Re: remove odd pixels in the image

Posted: 2014-11-26T01:55:39-07:00
by nagarwal
nagarwal wrote:
fmw42 wrote:try

Code: Select all

convert mn1-bRxR3LFR.png -fuzz 55% -alpha off -fill "rgb(230,230,230)" -opaque "rgb(63,63,63)" -alpha on show:

I only needed to change those blackish pixels on inside edges but it changes the images a lot and looses the original texture. the result is

Image

Re: remove odd pixels in the image

Posted: 2014-11-26T11:01:30-07:00
by fmw42
This is how you would do it.

Code: Select all

convert mn1-bRxR3LFR.png -alpha off -black-threshold 19.6% -fill "gray(230)" -opaque black -alpha on tmp1.png
where 19.6% = 100*(50/255) and gray(230)=rgb(230,230,230). You can increase the black-threshold value, if there are still some dark regions.


If you need to maintain the black in the below transparency region of the base image, then do

Code: Select all

convert mn1-bRxR3LFR.png -alpha off -black-threshold 19.6% -fill "gray(230)" -opaque black -alpha on \
-background black -alpha background tmp1.png


Alternately, you could use a clone stamp tool to modify those dark regions using Photoshop or GIMP

Re: remove odd pixels in the image

Posted: 2014-11-26T21:35:46-07:00
by nagarwal
Thanks, you have been a great help!