Gimp-Forum.net
pixel perfect squares - Printable Version

+- Gimp-Forum.net (https://www.gimp-forum.net)
+-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP)
+--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP)
+--- Thread: pixel perfect squares (/Thread-pixel-perfect-squares)



pixel perfect squares - gimpygirl - 03-04-2024

Hi

If you followed my font journey (hihi Big Grin ) in other posts: I have extracted a font sprite but it's not a perfect square.
What plugin or gimp operation I can apply to this image to make it a perfect square (it should be a 8x8 pixel square). So as a result the shape of the A is changed so it fits the perfect square (that's the goal!)
The black at the left and the bottom is PART of the square, because it's spacing for the font. It should not be removed.

This image is a separate layer of my image and I have layers for A -> Z and 0 -> 9. They all need to be adjusted.


RE: pixel perfect squares - Ofnuts - 03-04-2024

You scale to 8x8 with Interpolation None. But IMHO if you need to scale to 8x8 at that point, your workflow is weird. Why don't you get the characters as 8x8 from the beginning?


RE: pixel perfect squares - gimpygirl - 03-04-2024

(03-04-2024, 08:53 AM)Ofnuts Wrote: You scale to 8x8 with Interpolation None. But IMHO if you need to scale to 8x8 at that point, your workflow is weird. Why don't you get the characters as 8x8 from the beginning?

The source image has the image like this.

If I apply what you say, i get a tiny image which i can't see anymore
I need the image to have similar size but converted to a square (not a tiny 8x8 px image!).
The "pixels" in this image are enlarged already


RE: pixel perfect squares - Ofnuts - 03-04-2024

(03-04-2024, 02:55 AM)gimpygirl Wrote:
(03-04-2024, 08:53 AM)Ofnuts Wrote: You scale to 8x8 with Interpolation None. But IMHO if you need to scale to 8x8 at that point, your workflow is weird. Why don't you get the characters as 8x8 from the beginning?

The source image has the image like this.

If I apply what you say, i get a tiny image which i can't see anymore
I need the image to have similar size but converted to a square (not a tiny 8x8 px image!).
The "pixels" in this image are enlarged already

Then you scale to 133x133 (don't forget to unlink the with/height to make them independent).


RE: pixel perfect squares - gimpygirl - 03-04-2024

(03-04-2024, 09:13 PM)Ofnuts Wrote:
(03-04-2024, 02:55 AM)gimpygirl Wrote:
(03-04-2024, 08:53 AM)Ofnuts Wrote: You scale to 8x8 with Interpolation None. But IMHO if you need to scale to 8x8 at that point, your workflow is weird. Why don't you get the characters as 8x8 from the beginning?

The source image has the image like this.

If I apply what you say, i get a tiny image which i can't see anymore
I need the image to have similar size but converted to a square (not a tiny 8x8 px image!).
The "pixels" in this image are enlarged already

Then you scale to 133x133 (don't forget to unlink the with/height to make them independent).
Working!

What does interpolation mean: what does it do?


RE: pixel perfect squares - Ofnuts - 03-05-2024

(03-04-2024, 11:18 PM)gimpygirl Wrote: What does interpolation mean: what does it do?

It tells how scaled  pixels are computed. For instance, in your case, the pixel at (0,3) (ie, 4th pixel down from the top left corner) in the 133x133 result corresponds to the three pixels between (0,9) and (0,11) in the 133x399 image.
  • With Interpolation: None it is the copy of the "nearest neighbor", which is the pixel the closest to the corresponding source (here,  (0,9), but if you were using a non-integer scale factor, this could fall "between" two pixels). 
  • With Interpolation: Linear it would use a weighed average (a good deal of the closest pixel, and a bit of the 3 other surrounding pixels). 
  • The other algorithms are refinements that reduce blur. Cubic used to be popular because it wasn't too CPU intensive, but modern algorithms  (LoHalo and NoHalo) are well within the reach of any semi-recent computer (<20 years old).
Here since you are doing something close to pixels art, None is the best method because all other methods will introduce new colors.


RE: pixel perfect squares - gimpygirl - 03-05-2024

Are there specific pixel art plugins for gimp or methods used for this?