Open GoogleCodeExporter opened 9 years ago
what about cropping the sprite to the size of the biggest image? that way you
would
generate a 21px wide image [ Math.ceil(16/7)*7 ] and then crop it to 16px wide.
I
think it should be the easiest/best solution..
Original comment by millerme...@gmail.com
on 17 Sep 2009 at 6:27
These are repeating images - so you can't crop them.
Original comment by stevesou...@gmail.com
on 17 Sep 2009 at 6:52
I wasn't thinking about images that can't be "stretched" since every time that
I use
background-repeat is for images that can be stretched (like a gradient
background..)
I think the kind of logic that you're trying to achieve (combining all sizes
into the
same file) is impossible, because of prime numbers, and it can drastically
increase
the file size...
Using your example (and keeping the same logic) I would recommend creating 3
sprites
[2,5,10], [4,16] and [7]. - avoiding to repeat the 10px image and limiting the
image
repeat to 5x.. since if you use the 20px wide you would have 10 2px images..
If the repeated image could be stretched (gradient background) the number of
times
you repeat it shouldn't make a big differences in the file-size but if it's an
icon
it will.
Original comment by millerme...@gmail.com
on 17 Sep 2009 at 9:21
We're not able to make any assumptions about the images. It's not just icons -
Ive
created bg images that repeated but weren't stretchable (for example,
spriteme.org.).
Original comment by stevesou...@gmail.com
on 17 Sep 2009 at 10:05
Original issue reported on code.google.com by
stevesou...@gmail.com
on 1 Sep 2009 at 5:38