big problems with the newst IM on debian

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
omega1
Posts: 7
Joined: 2011-10-01T05:20:19-07:00
Authentication code: 8675308

big problems with the newst IM on debian

Post by omega1 »

hi

i have some big problems with the newest version of IM:


Debian Squeeze - ImageMagick 6.3.7 08/09/09 Q16:
Image


Debian Squeeze - ImageMagick 6.6.0.4 (installed with 'apt-get install imagemagick')
Image


(the original images are animated (imageshack rejects this animations)))

my im-code (php) looks like this:

Code: Select all

	$cmd = "convert -background transparent -font /path/to/font.ttf -pointsize 20 -gravity Center label:\"abkdfer kfdakdjaf\" ";

	for($i = 0 ; $i < $rounds ; $i++) { 

		$cmd .= " \( -clone 0 -tile /path/to/pattern[" . $i . "] -gravity Center -stroke 1 -annotate +0+0 \"abkdfer kfdakdjaf\" \) "; 
		
	} 

	$cmd .= " -delete 0 -set delay 11 -loop 0 -trim +repage -layers Optimize /path/to/save/image.gif 2>&1"; 
omega1
Posts: 7
Joined: 2011-10-01T05:20:19-07:00
Authentication code: 8675308

Re: big problems with the newst IM on debian

Post by omega1 »

any ideas?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: big problems with the newst IM on debian

Post by fmw42 »

compare the results of

convert -list configure

looking at the line starting with DELEGATES to see if they are the same, in particular, fontconfig and freetype. I forget which one is relevant.

if they both exist, check the version numbers and be sure they are up to date.


Why are you doing a label: and the follow it with -annotate? Does the label: do anything that -annotate does or cannot? Is the label: line being used? Seems that you only have shown a snippet and not the full code? Can you run the equivalent code in command line mode rather than via PHP? Is it any different?
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: big problems with the newst IM on debian

Post by anthony »

Also label: does quite a lot of tweeking to get the 'right' image size for the given string and font settings.
whcih makes aligning a label: with -annotate some what difficult.

The ONLY reason I see for using label: for -annotate is to get a starting canvas of the right size, and then do all your drawing using -annotate. I would however clear the initial label: image (leaving a blank image canvas) before using -annotate.

This technique is demonstrated in IM Examples,Automatically Sized Annotated Text Canvases
http://www.imagemagick.org/Usage/text/#annotate_size

Looking at the example it was difficult to determine for() loop is doing. There is no comment in the code explaining the reason for it (adding minimal comments is good coding practice). Eventually I figured it was generating an animation, something that is LOST when explaining the problem due to the image_hosts actions.

An alternative method of doing this (without needing a loop) , is...
IM Examples, Animation Modifications, Glitter Animations
http://www.imagemagick.org/Usage/anim_mods/#glitter

that is not to say you example is not correct, and seems quite a valid technique. I have used similar techniques myself (before -distort allowed for better technqiues).

I can not find anything wrong with the example that would cause the 'blocks of black' shown.

My only thought is that it is being generated by some interaction with the input 'glitter tile pattern'. Without those patterns it is going to be very hard to help you further. Simplify and provide input images so that we try out and actually test it on our systems. The act of reducing the example would actually help you (and help us) pinpoint the actual source of the problem.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
omega1
Posts: 7
Joined: 2011-10-01T05:20:19-07:00
Authentication code: 8675308

Re: big problems with the newst IM on debian

Post by omega1 »

thank you guys

yes i use the first 'label' to get the canvas in the right size.... the text is user input and i dont know the exact size. is it better to start with a big, blank canvas and trim it at the end?

i will try it with this "Glitter Animations"!
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Re: big problems with the newst IM on debian

Post by anthony »

I would blank that initial canvas, before the first annotation.

See Blanking Existing Images
http://www.imagemagick.org/Usage/canvas/#blank

Or just set fill temporary to 'none' so the test actually isn't drawn.


If you do find out what was the cause, please let us know.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
Post Reply