Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve some of the maps that have slightly better upstream versions #109

Merged
merged 3 commits into from
Jul 28, 2019

Conversation

aplaice
Copy link
Collaborator

@aplaice aplaice commented Jul 22, 2019

This probably should be split into smaller, atomic commits, but ideally the commits should also update sources.csv, which doesn't yet exist in master. I don't want to continue piling pulls on top of each other, so I'm just pushing this, in case you (or anybody else) has some comments.

The label-free version of the Pacific Ocean on Wikimedia is, for some reason huge (98 kB) and playing around with pngout and optipng doesn't help.

The new sources for the files (for my future reference, when updating sources.csv), haphazardly listed are:

@axelboc axelboc force-pushed the water_bodies_slight_improvement branch from a6db699 to 33faaa2 Compare July 27, 2019 14:52
@axelboc
Copy link
Collaborator

axelboc commented Jul 27, 2019

I've merged two of your PRs so far then rebased this one onto master and force-pushed it (so you may want to do a full checkout or reset rather than a pull). Great stuff, thanks heaps!

Let me know when you're done with this one. I've had a look at it on my end and only spotted one thing: the new ug-map-indian_ocean.png has a transparent background whereas the other ocean maps have white backgrounds. Might be slightly smaller in size and more consistent with a white background too.

@aplaice
Copy link
Collaborator Author

aplaice commented Jul 27, 2019

Thanks for looking at and merging the other PRs.

I've had a look at it on my end and only spotted one thing: the new ug-map-indian_ocean.png has a transparent background whereas the other ocean maps have white backgrounds. Might be slightly smaller in size and more consistent with a white background too.

Thanks for spotting that! I'll fix the transparency asap and finish this off.

@aplaice aplaice force-pushed the water_bodies_slight_improvement branch from 33faaa2 to ec9b8b6 Compare July 28, 2019 12:35
@aplaice
Copy link
Collaborator Author

aplaice commented Jul 28, 2019

I've replaced the Indian Ocean map with an older version that has a white background (to save myself playing around with transparencies). It's otherwise identical to the newest version, so I think there should be no issues. As a bonus, looking at older versions made me realise that there's an older, smaller version of the Pacific Ocean map (the addition of the transparency somehow increased the size sevenfold, when it should have increased it by several bytes, at most...), so I used that.

I split the pull request into several commits, as it made it easier to check that I had correctly updated all the necessary files.

@axelboc
Copy link
Collaborator

axelboc commented Jul 28, 2019

Awesome, thanks for the separate commits and for listing the sources 👍

Would you mind just shrinking the Denmark Strait map down to 500px wide to match most of the other maps? It looks a bit huge in Anki. The Celtic Sea map is also quite big. Perhaps a height of 500px would do as well?

@axelboc
Copy link
Collaborator

axelboc commented Jul 28, 2019

Oh and any reason why you picked 407px-wide versions for some of the other maps and not 500px-wide?

@aplaice
Copy link
Collaborator Author

aplaice commented Jul 28, 2019

Would you mind just shrinking the Denmark Strait map down to 500px wide to match most of the other maps? It looks a bit huge in Anki. The Celtic Sea map is also quite big. Perhaps a height of 500px would do as well?

Yes, of course, I'll do that.

Oh and any reason why you picked 407px-wide versions for some of the other maps and not 500px-wide?

I picked a width of 407px, as that was the width of the previous JPG versions, but I can standardise it to 500px-wide.

@axelboc axelboc added the chore Documentation, licenses, repository structure, dependency upgrades, etc. label Jul 28, 2019
@axelboc axelboc added this to the v3.2 milestone Jul 28, 2019
@aplaice aplaice force-pushed the water_bodies_slight_improvement branch from ec9b8b6 to a0d2f8c Compare July 28, 2019 19:52
aplaice added 3 commits July 28, 2019 21:59
They are taken from upstream with minimal changes.  In the case of the
Indian and Pacific Oceans, take older versions, since the new Indian
Ocean map has a transparent background, while the new Pacific Ocean
map is several times larger (and also has a transparent background).
For Polynesia, the labels and circles were removed as they were barely
readable and slightly confusing.

The number of colours (using `convert -colors 255`) was reduced for
the Azores, Ceuta and Melilla without any discernable drop in quality.
Testing showed that reducing the number of colours for Polynesia would
cause a drop in quality, presumably because its map isn't "flat"
like the others.

(Terminology-wise I think that it's not strictly speaking
colour-depth, as the images are still 8-bit.  I suspect that the
significant drop in size is due to transitions at boundaries, where
there would normally be a large range of different colours, but most
of which aren't really necessary for the depiction of a smooth
transition.)

(I have no idea why using 255 colours results in a non-negligible gain
compared to 256 colours — AFAIK `-colors n` *doesn't* mean `n + 1`
colours.)
For the Gulf of Mexico, note that the original NOAA image was indeed a JPG.
@aplaice aplaice force-pushed the water_bodies_slight_improvement branch from a0d2f8c to fce454c Compare July 28, 2019 20:00
@aplaice
Copy link
Collaborator Author

aplaice commented Jul 28, 2019

I think that I've fixed all the issues and rebased on top of master.

Slightly experimentally I've reduced the number of colours used for some of the "flat" maps, to reduce file sizes (without this, the "scaled down" maps of the Celtic Sea and Denmark Strait would have been far larger than the original PNGs).

@axelboc
Copy link
Collaborator

axelboc commented Jul 28, 2019

Brilliant, thank you!!

@axelboc axelboc merged commit 229f147 into anki-geo:master Jul 28, 2019
@aplaice aplaice deleted the water_bodies_slight_improvement branch July 28, 2019 23:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore Documentation, licenses, repository structure, dependency upgrades, etc.
Development

Successfully merging this pull request may close these issues.

None yet

2 participants