Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread Display Modes
Old Aug 11, 2013, 09:14 AM   #1
macrumors newbie
Join Date: Oct 2012
Image Magick Problem

I am using imagemagick to detect the color of one pixel of an image. I need a program in bash that matches the discovered hex cold to the nearest of 11 pre-definded pixels. Is this possible? Or do i need to write if/else statements for every possible tint of purple.
BobRon is offline   0 Reply With Quote
Old Aug 11, 2013, 08:34 PM   #2
macrumors newbie
Join Date: Jul 2011
Once you have defined a suitable a way of measuring distance between colours, all you need to do is loop through your 11 pre-defined pixels and choose the (or 'a' in some cases) closest one. Not sure why you'd dream of creating millions if/else statements!

Depending on your overall goal, you might want to try Image Magick's C++ API. Furthermore, if you're just looking up pixel values then maybe you should be using OpenImageIO.
mwb is offline   0 Reply With Quote

MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

bash, imagemagick, pixel, tint

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Problem with image MBP "15 TENDITER MacBook Pro 2 Apr 28, 2014 04:39 PM
Still image problem in iMovie '13? khoopes Mac Applications and Mac App Store 0 Oct 24, 2013 01:19 PM
Image Rotation problem xArtx iPhone/iPad Programming 4 Jun 7, 2013 12:19 PM
Resolved: Problem with image upload ? ChristianJapan Site and Forum Feedback 2 Oct 13, 2012 07:25 AM
Problem with user touches the marker on image in image targets srilatha iPhone 0 Oct 2, 2012 01:33 AM

Forum Jump

All times are GMT -5. The time now is 07:11 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2015, MacRumors.com, LLC