On Wed, Jul 30, 2008 at 10:56:30AM -0700, Fred Weinhaus wrote:
>
> How do you plan on arranging the images in the sprite file?
Vertically.
> How will you keep track of the positions?
Again, I'm scanning css files and extracting background url().
Once I have the path to the image I can use Ping to determine the
height of the image. That's really all I need.
The images are of different sizes, but they are all aligned on the
left edge of the resulting image.
So, say I add the first image of 10x10. It's accessed in css
by 0px 0px (upper left corner).
Then next image is added and it's size is 20x20. The "canvas" of the
image expands (with transparent background). It's css position is 0px
-10px (from previous image size).
Third image will be at 0px -30px.
> The simplest way I know is to sequentially append the files into one
> long image.
>
> convert image1 image2 -background black +append result
> convert result image3 -background black +append result
Well, I'm using PerlMagick, but not sure of the best approach.
This seems close, though:
$im = Image::Magick->new;
$im->Read( @list_of_image_paths );
$montage = $im->Montage(
mode => 'Concatenate',
tile => '1x',
background => 'none',
);
$m->Write( 'sprite.png' );
Is .png the best format to use? Writing to .gif in my simple tests
results in a smaller image.
Sorry, my knowledge of this is limited. So, any pointers or
suggestions would be very welcome.
--
Bill Moseley
[EMAIL PROTECTED]
Sent from my iMutt
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users