Mobile app version of vmapp.org
Login or Join
Kevin459

: Should I scale an image first, or index it? I have an image, it's the Backtrack_5_PitchBlack.jpg found at http://www.backtrack-linux.org/screenshots/, and I'd like to get it down to 640*480 for

@Kevin459

Posted in: #ColorIndexing #ColorSpaces #Gimp #Resize

I have an image, it's the Backtrack_5_PitchBlack.jpg found at www.backtrack-linux.org/screenshots/, and I'd like to get it down to 640*480 for a Grub4DOS splash screen.
Unfortunately, this also means I need to index it to 14 colors (or less) and save it as an XPM image.

I get that I can crop the whitespace around the edges (so as to avoid needing to scale the image unevenly,) but will I get better results doing the indexing before, or after the scaling?

To summarize:
I need to -


Crop the image from 16:10 to 4:3
Scale the image so that it's 480px high
index the image to 14 colors


I'm using GIMP, what's the best order of operations here? I'm most likely going to use the Floyd-Steinburg (normal) dithering, but I also need to know what the best Scaling algorithm for this is. I'd prefer to have it look as if it were vectored straight into that size - edges as smooth as possible.

10.03% popularity Vote Up Vote Down


Login to follow query

More posts by @Kevin459

3 Comments

Sorted by latest first Latest Oldest Best

 

@Bethany839

First crop and scale (or scale and crop)
then index to 14 colors.


For an extreme example, say we want to end up with a 2-color (blank and white) image that is 1/10 the size of some original image.
If we were to index first, generating a big black and white image,
then when we downscale 10:1,
we end up with a grayscale image -- 10x10 regions with few black pixels would downscale to one light grey pixel; 10x10 regions with few white pixels would downscale to one dark grey pixel, etc.
At best, we would end up with the same greyscale image that results from scaling the original image directly.
At worst, if we index first, and then scale, smooth gradients might be smashed into white on one side, black on the other side, with a distracting and meaningless edge somewhere in the middle.

Either way, it would be better to scale first, and then index.

p.s.
If you only have 14 colors available,
sometimes the final image looks better if you manipulate the image a little to manually "flatten" gradients to 3, 2, or even 1 solid color, letting the indexer use fewer index slots on gradients, and more index slots on anti-aliased pixels.

10% popularity Vote Up Vote Down


 

@Rambettina927

You'll want to scale first. Downsizing the image will compress your palette to some extent in and of itself. Indexing before hand would throw color away that may be helpful in the down-sampling step.

10% popularity Vote Up Vote Down


 

@Mendez620

I would scale then Index - I can't think of a technical reason why, but.. If in doubt try it both ways, it won't take long and you can compare them both afterwards to see which best fits the purpose.

[added]:

Scale, then index:



Index, then scale:

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme