Check out Glinski's Hexagonal Chess, our featured variant for May, 2024.


[ Help | Earliest Comments | Latest Comments ]
[ List All Subjects of Discussion | Create New Subject of Discussion ]
[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]

Single Comment

About Game Courier. Web-based system for playing many different variants by email or in real-time.[All Comments] [Add Comment or Rating]
🕸💡📝Fergus Duniho wrote on Wed, Mar 13 01:35 PM EDT in reply to Fergus Duniho from 12:39 PM:

Both appear to be fixed now. I had to color the new image green before copying the original image to it. Otherwise, some pixels in the original image might match the background color of the new image. Taking out the lines for filling it with the transparent color after copying the image fixed the problem with the PNG King's cross being partially transparent. What I needed to keep were the lines for identifying the transparent color in the new image.

So, the padding works like this.

  1. If the image is true color, it gets converted to a palette image.
  2. It identifies the transparent color in the original image. It first tries imagecolortransparent, then it looks for pure green, and if neither of those work, it assumes the color at (0,0) is transparent.
  3. It changes the RGB values of the transparent color to green (#00ff00).
  4. If either dimension of the image is below the value of $size, it creates a new $size x $size palette image.
    1. It colors this image green.
    2. It copies the palette of the original image to the new image.
    3. It copies the original image to the new image at a centered location.
    4. It recalculates the new image's transparent color in the same manner as before.
    5. It copies the variable for the new image to that of the original image.
    6. It destroys the original image.
  5. When it outputs the image, it assigns the transparent color to what was previously calculated to be the transparent color.