Wikipedia talk:Graphic Lab/Resources/Wikimaps atlas
Blog
edit04/09: Shaded reliefs: which formats ?
editThis section in a nutshell: While shaded relief bring an powerful and elegant 3D feel to wikimaps, the weight and quality of the bitmap file should be considered. |
Whe use heavy GIS tif to generate shaded relief files, first as .tif, then converted into the format of our wish. We got a talk about which format to use out of .tif, .jpg, .gif, .png. There is the summary :
Format | Opacity? | Quality | Compression/Weight |
---|---|---|---|
.tif | No | Yes | heavy |
.jpg | No | Yes | Yes |
.gif | 0 OR 100% | Yes | Yes |
.png | 0 to 100% | Yes | heavy |
The quality rather depends on the GIS raster, and our own crop and resizing choices.
The compression depends on the format's management of grey scale linear gradients, from white to black, which is the main component of native shaded reliefs.
The opacity support depends each format, and open different aesthetic possibility. Despite its poor management of linear gradients and subsequent heaviness, we will likely go for .png, which open better aesthetic possibilities. Yug (talk) 10:24, 11 April 2014 (UTC)
04/11: Elegant Shaded relief
editThis section in a nutshell: While shaded relief bring an powerful and elegant 3D feel to wikimaps, a subtile refining is needed it order to respect initial colors. |
Yug made a push and researches to integrate shaded_relief as one of the layers for the project. It's actually a very convenient layer, since we simply process the GIS raster into an elegant PNG raster, without the more complex use of topojson and D3js, as seen for other layers (administrative, topography). As for now, the result is a white-grey-black png as follow:
[input.png]
Past days, we started to a discussion with the French graphic lab, where talented and experienced wikicartographers gather. Shaded relief is described as an ambiguous layer. Commonly used "as it" with its grey base-color (#DDDDDD) for plains, black for mountain's shadows, and white for the enlighten sides, the whole at an opacity of ~30%, which, yet, heavily darken the map. Smarter usage require whitening, or transparency, which are done via GIMP as follow:
|
We have to reproduce this exact behavior using a command/script approach. The best lead we currently have is $convert, a sublibrary of ImageMagick. Planemad, who have a better understanding of bitmaps, bitmap chanels, and raster processing jumped in to solve this issue. Yug (talk) 07:35, 11 April 2014 (UTC)
04/11: Shaded relief, last try
editAs I researched for over one day without clear solution or lead, I accepted to leave this issue to Planemad, who have some expertise in alpha chanel manipulation, and may have a smoother navigation and research within this field. Gathering my elegantshades.makefile
trial, associated poor quality outputs, and relevant online documentations, I noticed a tiny keyword[1] :
|
This totally hooked me. So I went for a quest with my best friend: Google: Imagemagick convert alpha copy.
And there it is, unexpected, a full forum thread about Convert grayscale image to black plus transparency?. There is the gold out of it:
1a. To make black pixels of this image transparent and linearly keep the white pixels as they are, run this command:
1b. To make white pixels transparent and linearly keep the black as they are, use:
Manual:
|
The result is pretty elegant.
- References
[1]: http://www.imagemagick.org/script/command-line-options.php#alpha