On Fri, 11 Sep 2009 00:11:38 -0700
Glenn Linderman <[email protected]> wrote:
| > Try this instead...
| >
| > convert.exe \
| > -page +0+0 in.jpg \
| > -page +409+765 in.jpg \
| > -repage 1159x1515 -background white -compose multiply -flatten \
| > -compress zip -density 150 out.tif
| >
|
| Works perfectly.
|
| > What you have to remember is that -flatten always creates a canvas of the
current background color the size of the first images virtual canvas.
| > So you do not need to create that canvas yourself.
| >
|
| But the first image doesn't have the proper size canvas, it is too small
| (750x750). So I guess in your command above, the -repage, which, as far
| as I can tell, applies to the second copy of in.jpg, extends the
| canvas? Or what does? Or since you don't use (), maybe your -repage
| applies to all the images in the stack? I was using () to try to limit
| the effect of some of the options, but that may have been somewhat
| unnecessary for what I was trying to do.
|
Actually as it is outside the parentesis it is applied to BOTH
setting the virtual canvas size only, while leaving the virtual offset
as previously set by the other -page options.
| > The -page setting saves the 'virtual page' and 'virtual offset' into
| > any images created after it. While -repage does the same but for image
already in memory.
| >
|
| "image already in memory" -- should that be plural -- all images
| presently in memory, unless constrained to a subset via use of parentheses?
|
"All images in the current image sequence" would be the right phrase.
Parenthesis creates a new seperate image sequence.
Actually to save reading the image twice you can do this...
convert.exe in.jpg -repage 1159x1515+0+0 \
\( +clone -repage +409+765 \) \
-repage 1159x1515 -background white -compose multiply -flatten \
-compress zip -density 150 out.tif
As the image data in the clone of in.jpg is not modified, only its
virtual canvas position, the pixel memory will be shared by both images!
that is this would be a near instant copy with reduced memory usage!
the virtual canvas size will also have been set in the clone, though
that is not important in this case as flatten only looks at the first
image to determine the canvas generation, and thus the final image size.
| > The above also has the effect that the meta-data of the first image
| > will be preserved, where in what you have the meta-data will be lost.
| > Perhaps part of that meta-data was a Photoshop profile with image
| > resolution! The above will preserve that unless you add -strip.
| >
|
| There is no meta-data of interest. The -density setting overrides the
| resolution, anyway. Stripping (huge) Photoshop profiles is probably a
| good thing, for my usage.
|
Yes it a photoshop profile was present its 'resolution' setting would
override the JPG density setting, at least within the photoshop program.
| > There are lots of ways to skin a cat, and what method you use depends
| > on what you want that skin for, and how messy you like the results!
|
| Indeed!
|
| Well, I've been playing a bit with -size, since that seems to be the
| option that I had in the original command that produces the erroneous
| effect in current versions of ImageMagick, but didn't in earlier versions.
|
| It appears that with some of the techniques you have proposed, the -size
| setting isn't needed. But it appears that if it is used, it has a
| strange effect.
HOLD!!!! yes I know what is could on.
The -size setting is used for creation of NEW images. (such as xc: and
gradient:) however it is also used as a 'size' hint to the JPEG library
for use when reading in images.
Typically it is used to avoid reading in too much data. That is a large
digital photo when you plan to generate a small thumbnail. I did not know
that it can also increase the size of an input JPEG image!!!
I think that perhaps it is time that the JPEG image size hint
be delegated to a specific JPEG codec -define setting. The use of -size
with JPEG images seems to cause no end of problems!
See Im Examples, Thumbnails JPEG Handling...
http://www.imagemagick.org/Usage/thumbnails/#profiles
Such a change will not be backward compatible, but it seems to have out
lived its purpose.
Anthony Thyssen ( System Programmer ) <[email protected]>
-----------------------------------------------------------------------------
If we knew what it was we were doing, it wouldn't be called research.
-----------------------------------------------------------------------------
Anthony's Home is his Castle http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users