Search found 11998 matches

by snibgo
2010-05-27T15:08:53-07:00
Forum: Users
Topic: Convert sometimes very slow with creating histogram
Replies: 17
Views: 33035

Re: Convert sometimes very slow with creating histogram

By the way, if your image has more than 1024 colors in it, histogram:info: will color reduce your image to 1024 colors.
Is it supposed to? It doesn't under IM 6.6.0-8.

convert photo.jpg -format %c histogram:info:out.txt

for a typical photo gives many thousands of entries.
by snibgo
2010-05-27T13:48:55-07:00
Forum: Users
Topic: Convert sometimes very slow with creating histogram
Replies: 17
Views: 33035

Re: Convert sometimes very slow with creating histogram

fmw's technique doesn't alter the image file, merely an in-memory copy. As far as I know, performance should only suffer when there are a large number of distinct colours in the image (many more than 5!). My script won't suffer when there are many distinct colours. Can you post one of the poor-perfo...
by snibgo
2010-05-27T13:37:16-07:00
Forum: Users
Topic: Convert sometimes very slow with creating histogram
Replies: 17
Views: 33035

Re: Convert sometimes very slow with creating histogram

The histogram method finds unique colours, then sorts them, so it isn't fast. fmw: But color reduction might eliminate the queried colour? How about this (Windows 7 script): I want to count how many pixels are (252,0,0). I make all the other colours transparent, then convert these to black (or any c...
by snibgo
2010-05-27T12:57:02-07:00
Forum: Users
Topic: Batch file problems on XP with conert and composite
Replies: 3
Views: 6969

Re: Batch file problems on XP with conert and composite

Windows XP doesn't like filenames with slash (/). %date% probably contains slashes. The quotes in SET "TEST=C:\TEST\123.gif" don't make sense (but they seem harmless). FOR /f "delims=" %%I IN ('DIR *.JPG /b') could be FOR %%I IN (*.JPG) I don't know why 123.jpg might be a problem. What version IM do...
by snibgo
2010-05-27T04:09:47-07:00
Forum: Users
Topic: Thumbnail output file size questions
Replies: 14
Views: 24687

Re: Thumbnail output file size questions

By default, Firefox ignores ICC v2 and V4 profiles, but you can turn them on for v2, and it will then render identically (as far as I can see) to Safari. Ignoring profiles isn't a bug, it's the way that most browsers are designed. Organisations that use logos generally distribute them in various dig...
by snibgo
2010-05-26T16:51:03-07:00
Forum: Users
Topic: How do I limit JPG to 256 colors?
Replies: 3
Views: 8649

Re: How do I limit JPG to 256 colors?

I don't understand the question. Can you supply examples that illustrate it?

Jpeg is a lossy compression. It will introduce artifacts, which will change pixels.
by snibgo
2010-05-26T16:36:38-07:00
Forum: Users
Topic: Thumbnail output file size questions
Replies: 14
Views: 24687

Re: Thumbnail output file size questions

It's looking for the LCMS ("Little Color Management System", I think) delegate. (A delegate is a program that ImageMagick calls to do some work.) Without that, the "-profile sRGB.icm" won't work. Changing colorspace to RGB will do an approximate conversion, which might satisfy your users. For a more...
by snibgo
2010-05-26T16:03:45-07:00
Forum: Users
Topic: Thumbnail output file size questions
Replies: 14
Views: 24687

Re: Thumbnail output file size questions

Yes, that's a separate problem. See http://www.imagemagick.org/script/binary-releases.php for installing binary relases, or a related page for building from source.
by snibgo
2010-05-26T15:28:37-07:00
Forum: Users
Topic: Thumbnail output file size questions
Replies: 14
Views: 24687

Re: Thumbnail output file size questions

Thanks, Anthony.

As you note, different software displays non-sRGB images differently, sometimes bizarely.
by snibgo
2010-05-26T12:34:06-07:00
Forum: Users
Topic: Thumbnail output file size questions
Replies: 14
Views: 24687

Re: Thumbnail output file size questions

FYI: I recently surveyed which browsers and other programs respected ICC colour profiles, and put a table of results on http://www.snibgo.org/improf.htm
by snibgo
2010-05-26T12:13:06-07:00
Forum: Users
Topic: Turn an image into a background
Replies: 3
Views: 7644

Re: Turn an image into a background

This might do the trick:

convert in.png +level 75%,100% out.png
by snibgo
2010-05-26T09:46:16-07:00
Forum: Users
Topic: Thumbnail output file size questions
Replies: 14
Views: 24687

Re: Thumbnail output file size questions

Some browsers respect colour profiles, while others (notably IE) don't. I would expect them to move in the direction of respecting profiles. For browsers and other software that displays images while respecting profiles, if you simply strip the profile, you can expect the image to look different. Mo...
by snibgo
2010-05-25T08:08:00-07:00
Forum: Users
Topic: Telling the difference between color and grayscale image
Replies: 31
Views: 39481

Re: Telling the difference between color and grayscale image

Grayscale is 8-bit while color is 24-bit.
But some colour images are 8 bits per pixel, eg images with a pallette.

And some greyscale images are 24 bits per pixel (one channel of 24 bits, or 3 equal channels of 8 bits).
by snibgo
2010-05-25T07:55:23-07:00
Forum: Users
Topic: Simple subtract
Replies: 5
Views: 21096

Re: Simple subtract

More elegant and faster:

Code: Select all

convert A.gif B.gif -compose Change-mask -composite d.png
convert -background black d.png -flatten C.gif
by snibgo
2010-05-25T07:16:17-07:00
Forum: Users
Topic: Simple subtract
Replies: 5
Views: 21096

Re: Simple subtract

Imagemagick "subtract" is an arithmetical operation. So a white pixel minus a blue pixel is a yellow pixel. (Subtract three from ten: the result is neither three nor ten.) You want: - where two pixels are the same, the result should be black - where they are different, you want the pixel from A. Thi...