Page 1 of 1
Converting galaxy images to greyscale
Posted: 2014-09-23T08:37:30-07:00
by mhwombat
I am trying to convert galaxy images to greyscale, but I need to preserve most of the detail of the spiral "arms". I have read ImageMagick tutorials, and tried loads of different filters, thresholds, other options etc., but I'm not having any luck. Can anyone offer any suggestions?
Here is a sample image:

Re: Converting galaxy images to greyscale
Posted: 2014-09-23T10:40:02-07:00
by fmw42
try this
Code: Select all
convert 1237648673994965546.jpg -colorspace cmyk -channel black -separate +channel \
1237648673994965546_black.png
or negate it
Code: Select all
convert 1237648673994965546.jpg -colorspace cmyk -channel black -separate +channel \
-negate 1237648673994965546_black_neg.png
In Windows replace the end of line \ with ^
Re: Converting galaxy images to greyscale
Posted: 2014-09-25T04:12:51-07:00
by mhwombat
I finally found a magick incantation that works well:
Code: Select all
-set colorspace RGB -colorspace gray
@fmw42: Those commands generated colour pictures with lots of speckle-y artifacts.
Re: Converting galaxy images to greyscale
Posted: 2014-09-25T19:11:27-07:00
by fmw42
mhwombat wrote:
@fmw42: Those commands generated colour pictures with lots of speckle-y artifacts.
They work perfectly fine for me on the image you provided when using IM 6.8.9.7 Q16 Mac OSX. What version of IM are you using and what platform? Always a good idea to identify those when asking a question
Re: Converting galaxy images to greyscale
Posted: 2014-09-26T04:34:03-07:00
by mhwombat
I'm on Debian "Sid". And interestingly, I just completed a system update, and now the command works fine. So perhaps it was a bug that's been fixed.
Now I'm running ImageMagick 6.8.9-6 Q16 x86_64 2014-09-06. Don't know what I was running just before the update.