sharpen / eliminate fuzziness in .jpg
sharpen / eliminate fuzziness in .jpg
I am trying to get this image so there are just the simple basic color and lines, etc., and eliminate the "fuzzziness" between colors. For example, the pale blue represents lakes and that should be all one color, the line around the pale blue, should be a darker blue. I am trying to get a distinct colors, not all the pixels of blue between the pale and the darker.
https://goo.gl/photos/GDd26WTjVChqRTMw5
https://goo.gl/photos/GDd26WTjVChqRTMw5
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: sharpen / eliminate fuzziness in .jpg
Use an interactive color picker to select the main colors you want to have preserved. Make a colortable image as an appended image of each color as a pixel. Use -dither none -remap with the colortable image to process your image. See http://www.imagemagick.org/Usage/quantize/#remap
Code: Select all
convert -size 1x1 xc:"color1" xc:"color2" ... xc:"colorN" +append colortable.png
convert image -dither none -remap colortable.png result
Re: sharpen / eliminate fuzziness in .jpg
Thank you! I can use an interactive color picker and get the various colors, but how do I make an appended image of each color? Do I use GIMP to create the appended image?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: sharpen / eliminate fuzziness in .jpg
The first convert command above in my previous post is creating the appended colors to make the colortable. You just supply as many
xc:"color" arguments as needed as indicated by the ... xc:"colorN".
xc:"color" arguments as needed as indicated by the ... xc:"colorN".
Re: sharpen / eliminate fuzziness in .jpg
On the first line I get an error message "missing an image filename", so I changed the line as below:
convert c:\myimage.jpg xc:"bbd5fa" xc:"d3e0c6" +append c:\colortable.png
but, I no matter how colors I add, I always get an error message: "unrecognized color 'd3e0c6'
the last part of the error message has whatever color is the last color in the command line.
I also tried as below using colorN and substituting the N for the number of colors, but I also get an error message with tha.
convert c:\myimage.jpg xc:"bbd5fa" xc:"d3e0c6" cx:"color2" +append c:\colortable.png
convert c:\myimage.jpg xc:"bbd5fa" xc:"d3e0c6" +append c:\colortable.png
but, I no matter how colors I add, I always get an error message: "unrecognized color 'd3e0c6'
the last part of the error message has whatever color is the last color in the command line.
I also tried as below using colorN and substituting the N for the number of colors, but I also get an error message with tha.
convert c:\myimage.jpg xc:"bbd5fa" xc:"d3e0c6" cx:"color2" +append c:\colortable.png
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: sharpen / eliminate fuzziness in .jpg
try this, with no input image.
Also hex colors must start with # as in #FF0000 for red
see http://www.imagemagick.org/script/color.php
Code: Select all
convert -size 1x1 xc:"color1" xc:"color2" ... xc:"colorN" +append colortable.png
see http://www.imagemagick.org/script/color.php
Re: sharpen / eliminate fuzziness in .jpg
Thank you for the clarification, that worked, I was able to create the colortable.png file. For the second line,when I write it as below, I get an error message: "unable to open image 'none': No such file or directory"
Code: Select all
convert c:\test.jpg -dither none -remap colortable.png c:\test\result.jpg
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: sharpen / eliminate fuzziness in .jpg
That does not make sense. It should work. try
Perhaps you need to put the full path to the colortable.png image. Seems you may have written it to some other directory from where you are running the script.
To make life simpler, I generally run the convert command from the directory where I have all my images, so that I do not have to use full paths. So change directories to where you have both test.jpg and colortable.png. The just run the command with only the file names. If you want the result in some other directory, then use the full path for that.
Code: Select all
convert c:\test.jpg +dither -remap colortable.png c:\test\result.jpg
To make life simpler, I generally run the convert command from the directory where I have all my images, so that I do not have to use full paths. So change directories to where you have both test.jpg and colortable.png. The just run the command with only the file names. If you want the result in some other directory, then use the full path for that.
Re: sharpen / eliminate fuzziness in .jpg
I put the images in the same directory as IM and then wrote the command line as below:
but, I still get the error message, "unable to open image 'none'
Code: Select all
convert test.jpg -dither none -remap colortable.png converted.jpg
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: sharpen / eliminate fuzziness in .jpg
Did you try +dither rather than -dither none. If that does not work, post your command for creating the colortable.png image and I will try to process it.
What version of IM are you using? If old, then perhaps upgrade. Note that -remap used to be -map. So if you have a very old IM version, try -map rather than -remap.
What version of IM are you using? If old, then perhaps upgrade. Note that -remap used to be -map. So if you have a very old IM version, try -map rather than -remap.
-
- Posts: 12159
- Joined: 2010-01-23T23:01:33-07:00
- Authentication code: 1151
- Location: England, UK
Re: sharpen / eliminate fuzziness in .jpg
What version of IM are you using? If older than 6.9.0, I suggest you upgrade.RCinSTP wrote:unable to open image 'none'
snibgo's IM pages: im.snibgo.com
Re: sharpen / eliminate fuzziness in .jpg
I downloaded the latest version of IM and installed it and put the test.jpg and colortable.png in the IM folder and the error message still shows the IM is expecting "none" to be a filename. Perhaps "none needs a minus or plus sign in front of it or something?
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: sharpen / eliminate fuzziness in .jpg
No, it should work.RCinSTP wrote:I downloaded the latest version of IM and installed it and put the test.jpg and colortable.png in the IM folder and the error message still shows the IM is expecting "none" to be a filename. Perhaps "none needs a minus or plus sign in front of it or something?
Post your command to create the colortable image and I will test both commands.
Re: sharpen / eliminate fuzziness in .jpg
If you succeed in getting what you asked for, you'll probably be disappointed in how "jaggy" the transitions between the light blue and dark blue become.
For example,
reduces the colors set to 15 colors, doesn't dither, and produces an image with jaggy lakeshores, contour lines, and numbers. Since you are starting with an image that has already been dithered and converted to JPEG, I don't know how to do much better. Are you wanting to have the final result in JPEG also? If so, try
Try other small values for "-colors". For this image, "-colors 8" works fairly well.
For example,
Code: Select all
convert test.jpg +dither -colors 15 test-c15+d.png
Code: Select all
convert test.jpg +dither -colors 15 -quality 92 test+d-c15-q92.jpg
Re: sharpen / eliminate fuzziness in .jpg
I apologize, it has been sometime since I have worked with ImageMagick and I didn't realize that there is a version for Windows 64-bit, with full install. I finally figured this out, installed the correct version and now the commands are working fine.
I have many 256x256 pixel image tiles, similar to this image. I am trying to clean up these images so that I can convert them to vector images which I can then convert to a map for a GPS. The GPS map program only works with vector images. I'm using Vector Magic and the results are not quite good enough, that is why I am trying to clean up the images before converting them to vector. I've heard of potrace but my understanding is that it only works with black and white images.
http://vectormagic.com/
I have many 256x256 pixel image tiles, similar to this image. I am trying to clean up these images so that I can convert them to vector images which I can then convert to a map for a GPS. The GPS map program only works with vector images. I'm using Vector Magic and the results are not quite good enough, that is why I am trying to clean up the images before converting them to vector. I've heard of potrace but my understanding is that it only works with black and white images.
http://vectormagic.com/