PySolFC icon indicating copy to clipboard operation
PySolFC copied to clipboard

Improve Ganjifa images

Open joeraz opened this issue 2 years ago • 4 comments

I recently added a hi-res Ganjifa deck in a PR to PySol cardsets. Once my two open PRs on the cardsets repo are merged, PySol should have a hi-res cardset for each type for the next release.

However, unlike the other cardsets, I could not find any Ganjifa card images with a usable license, so I had to enlarge the existing cardsets manually. While the cards look nice, I feel like they would benefit from a once over from someone with better image editing experience than me. This would cover both the bottoms in this repo and the cardsets in the cardset repo PR.

For example:

  • I think I did a good job with the suit images, but they still feel a little off in places.
  • The images of the court cards had to be enlarged and sharpened with some image-editing algorithms, but still look a bit blurry and streaky in places.
  • The shadow images are just wrong. Unfortunately, the cardset maker can't currently make shadow images for non-rectangular cardsets, and I couldn't get them to align right when I tried to make them myself. Though this probably isn't a big deal as the shadow images are only used when Pillow is missing, and I'd imagine anyone who uses hi-res cardsets would be using Pillow.

Not a huge priority, but should probably post before I forget.

joeraz avatar Jan 11 '22 22:01 joeraz

  • Unfortunately, the cardset maker can't currently make shadow images for non-rectangular cardsets

To be truth, cardsetmaker supports until now only french sets with 52 cards.

and

As shadows look fine in PysolFC, i never had a look at it.

++++

For users who want to make Ganjfa Sets for their own use. Here they can find 124 sets in good quality. https://ignca.gov.in/online-digital-resources/digital-images/ganjifa-cards/

*"You may view or download an image to your workstation and store it, and you may make hard copies without further permission"

cardset avatar Jan 26 '22 17:01 cardset

For the moment, until i continue with cardset maker.

shadows:

from PIL import Image
from PIL import ImageFilter


file = "pythonlogo.png"

image = Image.open(file)

image = image.convert("RGBA")  # make sure it has alphachannel
shadow = image.copy()

#could be red, blue or something else
colour = Image.new("RGBA", image.size, "black")
colour.putalpha(100)  # transparency

shadow.paste(colour, (0, 0), shadow)

iterations = 1  # not necessary, but gives nice effect.

for i in range(iterations):
    shadow = shadow.filter(ImageFilter.BLUR)

shadow.show()

pythonlogo

cardset avatar Jan 26 '22 18:01 cardset

The cardset contains shadow images which are used to generate the shadows when Pillow is not installed. If Pillow is installed, it generates good shadows for every cardset, but if it's missing, the images are used, and the current shadow images for the new XL Ganjifa decks are not right.

As these are only used when Pillow is not installed, I don't consider it a high priority, but still worth reporting.

joeraz avatar Jan 29 '22 17:01 joeraz

There are many images of Hindu deities on Wikimedia Commons. The problem is, it is not so easy to find images of their carriers, weapons, and so on. https://commons.wikimedia.org/wiki/Category:Paintings_of_Hindu_deities

GrimPixel avatar Sep 29 '22 09:09 GrimPixel