Discussion:
Grayscale from color
Ian Hall
2010-04-30 01:18:27 UTC
Permalink
I have PDF images with many colors and have used convert to change them
to grayscale.

My problem is that the original images contain large chunks of yellow
text and linework and when this yellow converts to grayscale the yellow
portions are very light gray indeed.

I think that what I need to do is to change all yellow graphics to black
and then convert the resultant image to grayscale. I don't know how to
do this and would appreciate advice from your users.

Thanks you.


Ian Hall
GIS Co-ordinator

East Gippsland Water
P 03 5150 4433
F 03 5150 4477
E ***@egwater.vic.gov.au <mailto:***@egwater.vic.gov.au>
W www.egwater.vic.gov.au <http://www.egwater.vic.gov.au/>



#####################################################################################
Scanned by MailMarshal - Marshal8e6's comprehensive email content security solution.
Download a free evaluation of MailMarshal at www.marshal.com
#####################################################################################
Fred Weinhaus
2010-04-30 15:46:41 UTC
Permalink
Post by Ian Hall
I think that what I need to do is to change all yellow graphics to black
and then convert the resultant image to grayscale. I don't know how to
do this and would appreciate advice from your users.
convert image.pdf -fuzz XX% -fill black -opaque yellow ...

will change colors near yellow within the XX% to black
Bob Meetin
2010-05-10 23:22:02 UTC
Permalink
http://www.imagemagick.org/script/install-source.php

I'm not a tech engineer type, thus installation from packages is not in
my comfort level bag of tricks. Someone suggested adding
"--disable-openmp" along in the installation process and perhaps that
would resolve the slowness problem. I really need the steps laid out
for me, where this happens in the procedures on imagemagick.org.

I have root access to the webhost server where this has to be done (not
on my linux pc) and am comfortable working from the command prompt via
SSH access. A question I have - Is it possible to rename the live
installation so that if I goof up in the install that I can retrace my
steps, and if so, which folders would I need to rename or move?

After ftp-ing the package to the server:

server% tar xvfz ImageMagick.tar.gz
server% cd ImageMagick-6.6.1
server% ./configure
server% make
server% sudo make install (will already be root so sudo probably not
necessary)

Where does the --disable-openmp come into play?
Anything else?

Again -the original problem, with the current hosting if I add a simple
"-resize" option it takes a minimum of 8 seconds for convert to complete.

-Bob
d***@imagemagick.org
2010-05-10 23:24:13 UTC
Permalink
Post by Bob Meetin
Where does the --disable-openmp come into play?
Add --disable-openmp to the configure command line. You can install
ImageMagick in a favored location with the configure script option,
--prefix.
Bob Meetin
2010-05-10 23:57:42 UTC
Permalink
Post by Bob Meetin
Where does the --disable-openmp come into play?
Add --disable-openmp to the configure command line. You can install
ImageMagick in a favored location with the configure script option,
--prefix.
server% which convert
/usr/bin/convert

Before doing the install if I rename the current binary to, say,
convert-o, is that enough or is it drawing upon other folders of files
that must also be renamed? What about identify which I commonly use and
some of the other commands?

What would be an example of a favored location, perhaps /bin, as in
"./configure --disable-openmp --prefix /bin"? Would this lead to any
conflicts with shared library files or anything else?

server% tar xvfz ImageMagick.tar.gz
server% cd ImageMagick-6.6.1
server% ./configure --disable-openmp
server% make
server% make install

If I do the above is it going to overwrite the current install or prompt
me to uninstall first?

Sorry about all the questions, but this is not what I do.

Thx again, Bob
Anthony Thyssen
2010-05-11 03:06:14 UTC
Permalink
On Mon, 10 May 2010 17:57:42 -0600
magick-users-***@imagemagick.org wrote:

|
| >> Where does the --disable-openmp come into play?
| >> Add --disable-openmp to the configure command line. You can install
| >> ImageMagick in a favored location with the configure script option,
| >> --prefix.
| >>
| server% which convert
| /usr/bin/convert
|
| Before doing the install if I rename the current binary to, say,
| convert-o, is that enough or is it drawing upon other folders of files
| that must also be renamed? What about identify which I commonly use and
| some of the other commands?
|
| What would be an example of a favored location, perhaps /bin, as in
| "./configure --disable-openmp --prefix /bin"? Would this lead to any
| conflicts with shared library files or anything else?
|
| server% tar xvfz ImageMagick.tar.gz
| server% cd ImageMagick-6.6.1
| server% ./configure --disable-openmp
| server% make
| server% make install
|
| If I do the above is it going to overwrite the current install or prompt
| me to uninstall first?
|
| Sorry about all the questions, but this is not what I do.
|
| Thx again, Bob
| _______________________________________________
| Magick-users mailing list
| Magick-***@imagemagick.org
| http://studio.imagemagick.org/mailman/listinfo/magick-users


Without a --prefix it will overwrite the install at the 'standard'
location. See my other email on how to run a IM at a non-standard
prefix location.


Anthony Thyssen ( System Programmer ) <***@griffith.edu.au>
--------------------------------------------------------------------------
How many programmers does it take to change a light bulb?
None. It's a hardware problem.
--------------------------------------------------------------------------
Anthony's Castle http://www.cit.griffith.edu.au/~anthony/
d***@imagemagick.org
2010-05-11 00:23:47 UTC
Permalink
Post by Bob Meetin
If I do the above is it going to overwrite the current install or prompt
Add --prefix to your configure script command line.
Anthony Thyssen
2010-05-11 02:09:57 UTC
Permalink
On Mon, 10 May 2010 17:23:47 -0700
magick-users-***@imagemagick.org wrote:

| > If I do the above is it going to overwrite the current install or prompt
|
| Add --prefix to your configure script command line.
|

I do this for a HDRI version of IM.

I build it with a --prefix to install in a specific location.

I then use a script called 'hdri' to call this version of IM

=======8<--------CUT HERE----------axes/crowbars permitted---------------
#!/bin/sh
#
# hdri imagemagick_command....
#
# Run the HDRI version of imagemagick (or other personal installed IM)
#
###
#
# Anthony Thyssen 1 July 2009
#

# Where is the HDRI version of IM stored (configure --prefix setting)
export MAGICK_HOME=/opt/im_hdri

# Yes these are still necessary - especially if MAGICK_HOME has moved
# from where IM was installed using configure --prefix
#
# The LD_LIBRARY_PATH is especially important to get the right library.
#
# However the PATH does not help IM find the "show:" delegate!
# That is the location of "display" is hardcoded in the show delegate!
# As such if the MAGICK_HOME directory is moved "show:" will fail
# unless I remove the path from the "delegate.xml" file and add the
# following environment variables.
#
export PATH="$MAGICK_HOME/bin:$PATH"
export LD_LIBRARY_PATH="$MAGICK_HOME/lib:$LD_LIBRARY_PATH"

# Execute the HDRI version of the command
exec "$@"

=======8<--------CUT HERE----------axes/crowbars permitted---------------

now I cane use

hdri convert ....

to use that version of IM.




Anthony Thyssen ( System Programmer ) <***@griffith.edu.au>
--------------------------------------------------------------------------
Windows Multitasking :- Start a download, Get a Coke, Fly a kite.
--------------------------------------------------------------------------
Anthony's Castle http://www.cit.griffith.edu.au/~anthony/
Bob Meetin
2010-05-12 03:15:52 UTC
Permalink
I installed ImageMagick using the --disable-openmp option and this
solved the problem. Curiously however, when I would check which version
of convert it came back with /usr/local/bin/convert as opposed to
/usr/bin/convert which was where the honorific hostgator s/a staff
installed it leading to the disaster.

% which convert
/usr/local/bin/convert

I ran convert without forcing the path and it balked and took about 9
seconds. Then when I ran it with the full path, it worked flawlessly:

/home/www% uptime ; date ; /usr/local/bin/convert oak_tree.jpg -resize
480 -strip oak_tree480.jpg ; date ; uptime
21:50:56 up 13 days, 1:24, 2 users, load average: 0.17, 0.52, 1.22
Tue May 11 21:50:56 CDT 2010
Tue May 11 21:50:56 CDT 2010
21:50:56 up 13 days, 1:24, 2 users, load average: 0.17, 0.52, 1.22

I installed a second time using he --prefix option but it did not seem
to make any difference.

./configure --disable-openmp --prefix /usr/bin

I thought this would overwrite the /usr/bin/convert but it did not. Do
you have to do a dash or perhaps double-quote /usr/bin in order for it
to be recognized?

To get past this in the meantime I rename /usr/bin/convert and created a
hard link from /usr/local/bin/convert. Probably should do the same with
identify if this is the only way.

-Bob
Anthony Thyssen
2010-05-12 03:51:15 UTC
Permalink
On Tue, 11 May 2010 21:15:52 -0600
magick-users-***@imagemagick.org wrote:

| I installed ImageMagick using the --disable-openmp option and this
| solved the problem. Curiously however, when I would check which version
| of convert it came back with /usr/local/bin/convert as opposed to
| /usr/bin/convert which was where the honorific hostgator s/a staff
| installed it leading to the disaster.
|
| % which convert
| /usr/local/bin/convert
|
| I ran convert without forcing the path and it balked and took about 9
| seconds. Then when I ran it with the full path, it worked flawlessly:
|
| /home/www% uptime ; date ; /usr/local/bin/convert oak_tree.jpg -resize
| 480 -strip oak_tree480.jpg ; date ; uptime
| 21:50:56 up 13 days, 1:24, 2 users, load average: 0.17, 0.52, 1.22
| Tue May 11 21:50:56 CDT 2010
| Tue May 11 21:50:56 CDT 2010
| 21:50:56 up 13 days, 1:24, 2 users, load average: 0.17, 0.52, 1.22
|
| I installed a second time using he --prefix option but it did not seem
| to make any difference.
|
| ./configure --disable-openmp --prefix /usr/bin
|
| I thought this would overwrite the /usr/bin/convert but it did not. Do
| you have to do a dash or perhaps double-quote /usr/bin in order for it
| to be recognized?
|
| To get past this in the meantime I rename /usr/bin/convert and created a
| hard link from /usr/local/bin/convert. Probably should do the same with
| identify if this is the only way.
|
| -Bob
|
--prefix should be in the 'containing directory' for all bins and
libraries.

That is --prefix=/usr
is what you should have used.

you will find you now have a four sub-directories in /usr/bin
that will need to be cleaned up... eg
/usr/bin/bin
/usr/bin/lib
/usr/bin/include
/usr/bin/share

I do not and never have recommended any software package be directly
installed when it is not part of a package management system.
Any direct installed packages is best installed in a /opt sub-directory
such as --prefix=/opt/im (put everything in /opt/im sub-dir)

This keeps it separate and easy to clean up, especially if you want to
test or try multiple different packages.



Anthony Thyssen ( System Programmer ) <***@griffith.edu.au>
--------------------------------------------------------------------------
Imagine if every Thursday your shoes exploded if you tied them the
usual way. This happens to us all the time with computers, and
nobody thinks of complaining. -- Jef Raskin
--------------------------------------------------------------------------
Anthony's Castle http://www.cit.griffith.edu.au/~anthony/
Steven Matison
2010-05-21 15:13:33 UTC
Permalink
Definitely the last thing I wanted to hear today....


The color profiles on my image conversion server are broken again.

Few weeks ago, we had a hdd failure and redid the OS with raid1. I
duplicated my working setup document to the T, and it looks like all
dependencies are in place with the right versions. However, when I
run an image that needs this color profile to work, it completely
trashes out and ends with the famous "convert: Color profile operates
on another colorspace `icc'."


CentOS release 5.4 (Final)
ImageMagick i386 6.2.8.0-4.el5_1.1
lcms i386
1.18-0.1.beta1.el5_3.2



Has anyone else dealt with this recently? I still cannot find much
about this on this list, or any other sources.


Will pay for solution.


Thanks,

Steven Matison
Scene Server

Loading...