anki-geo / ultimate-geography

Geography flashcard deck for Anki
https://ankiweb.net/shared/info/2109889812
Other
761 stars 79 forks source link

Vectorize flags #587

Closed KentGrigo closed 1 year ago

KentGrigo commented 1 year ago

Issue: https://github.com/anki-geo/ultimate-geography/issues/534 Follow-up on https://github.com/anki-geo/ultimate-geography/pull/577

This PR will vectorize the following flags:

The blurred version of these flags were not vectorized because I wasn't able to blur them properly:

This means that the question will be on the rasterized, blurred version of the flag and flip to the vectorized flag.

Note that I've updated many of the flags to correspond to the first flag shown on the countries' Wikipedia pages.

aplaice commented 1 year ago

Thanks for the PR!

Since AFAICT the GitHub diff viewer isn't displaying the changes too conveniently, here are the image changes (old flag and then new):

Belize :heavy_check_mark:

The proportions have changed, but this is correct. (The proportions should be 3:5 as in the new SVG.)

(AFAICT the source file has undergone a flurry of changes in the past couple of years.)

Bolivia

Blurred:

This is still the state flag, but with a slightly different coat-of-arms (old source vs. new source.). I'm not quite sure why the state flag linked/displayed on Wikipedia has changed...

~I would very strongly prefer the blurred image and the non-blurred one, not to differ (other than blurring), and definitely not significatly, like here.~ Now addressed!

~However, if we were to follow our current guidelines ("first flag") we should switch to the civil flag, so we should resolve #111 first (since the blurring issue might become moot).~ Edit: I'm an idiot, that is not our guidelines...

Costa Rica

We're removing the coat of arms (switching from state to civil flag). To avoid back-and-forth we should resolve #111, first.

El Salvador :white_check_mark:

Blurred:

~The blurred and unblurred images now differ slightly (other than in the blur), but this is IMO borderline-OK.~ Now addressed!

Peru

We're removing the coat of arms (switching from state to civil flag). To avoid back-and-forth we should resolve #111, first.

Venezuela

We're removing the coat of arms (switching from state to civil flag). To avoid back-and-forth we should resolve #111, first.


Several issues (as mentioned above):

  1. IMO the blurred image should be the same (apart from blurring :)) as the non-blurred image. ~(Blocking, but potentially superseded by 2 since we might not need blurring for Bolivia.)~ (Edit: I'm an idiot — see above.)
  2. We should resolve #111 before switching any more flags to avoid annoying (for users) back-and-forth. (Technically, we're not releasing soon, so we could change and then change back, but it's easy to forget.)

    Sorry — you're following the guidelines, but we're not sure whether the guidelines are actually appropriate, here...

  3. In the long run, the blurred images should also be SVGs, but that can wait.
axelboc commented 1 year ago

For blurring, I could see us being able to add a filter tag to the SVG file and apply the filter conditionally with CSS to the paths/texts that need to be blurred. IMO, it'll be easier to do this as part of the vectorising work than to update the blurred PNGs.

aplaice commented 1 year ago

For blurring, I could see us being able to add a filter tag to the SVG file and apply the filter conditionally with CSS to the paths/texts that need to be blurred.

That would be convenient, but I don't think we can apply CSS to SVGs that are imgs (as opposed to SVGs that are inline). (CSS embedded in the SVG files themselves would work, but not CSS in the main Anki template. (i.e. We'll need two image files anyway.)) (See here for a good description of why not.)

IMO, it'll be easier to do this as part of the vectorising work than to update the blurred PNGs.

Yes, we definitely shouldn't update the blurred PNGs, but replace them with something derived from the relevant vector images!

axelboc commented 1 year ago

Ah good point, that's a shame 👍

ukanuk commented 1 year ago

From CONTRIBUTING.md:

The name should be blurred using Inkscape's Gaussian blur effect as explained in https://github.com/anki-geo/ultimate-geography/pull/247.

KentGrigo commented 1 year ago

Thanks @ukanuk, but I already checked that out. Unfortunately, it only states how to apply the filter, not how to make the selection. However, I've now had the time to look into it and found a solution.


For future reference, here's a guide on how to blur a selection of an SVG file.

To select the part to be blurred

To blur

KentGrigo commented 1 year ago

@aplaice, this should fix 1. and 3.

KentGrigo commented 1 year ago

I tried to re-request a review from both of you (@aplaice & @axelboc), but it keeps removing the other.

I've now change the flag of Costa Rica back to the state version, but now vectorized. Also, I added a blurred version as the banner says Republica de Costa Rica.

axelboc commented 1 year ago

Summary of changes for future release notes: