File:population-earth1.png: Difference between revisions

Updated the "preserve sums" syntax (it's '$' now, not '_')
(An Term:isochromic map of the world population, superimposed on a pastel-color background that shows land, water, and borders. Everything in black is population. Note: Some border lines may be completely obscured by populations (especially India's borders with Bangladesh, Pakistan, and Bhutan). Still better than the opposite (letting the border lines obscure the populations).)
 
(Updated the "preserve sums" syntax (it's '$' now, not '_'))
 
(4 intermediate revisions by 2 users not shown)
Line 4: Line 4:
Everything in black is population.
Everything in black is population.


Note: Some border lines may be completely obscured by populations (especially India's borders with Bangladesh, Pakistan, and Bhutan). Still better than the opposite (letting the border lines obscure the populations).
'''Note:''' Some border lines may be completely obscured by populations (especially India's borders with Bangladesh, Pakistan, and Bhutan). Still better than the opposite (letting the border lines obscure the populations).
 
'''Note:''' Be careful not to confuse small blue dots (lakes) for small black dots (population). In the next version I'll try to make the blue parts lighter (or erase small bodies of water) so this doesn't happen.
<!--
TODO: try making another [[:File:blue-marble-posterized.png]] where i blur it before posterizing, so small lakes don't appear at all. be sure to check that most of the coastlines would still align with [[:File:borders-black-on-white.png]]. we'll see how it turns out
TODO: also try just changing the image generator code to lighten the blue parts (<code>r *= 1.1</code> and <code>g *= 1.1</code> perhaps - and if forests and deserts look less distinguishable from each other, so be it). Note this might still not be good enough as some image downscaling algorithms aren't gamma-corrected, so dark-ish edges between blue and (green or yellow) may still be enough to look like population. we'll see.
TODO: probably just gonna use [[File:continents-black-on-white.png]] instead of [[File:blue-marble-posterized.png]]. Not as aesthetic but still nice enough, and not as prone to misinterperetation. Maybe call it [[File:population-earth2.png]]? or even just [[File:population.png]]?
-->
 
==Methodology==
 
[[Code:isochromic.c|Image generator]] code:
 
# load files
pop << data/[[:File:population.data-float64-8640x4320|population.data-float64-8640x4320]]
earth << data/[[:File:blue-marble-posterized.png|blue-marble-posterized.png]]
borders << data/[[:File:borders-black-on-white.png|borders-black-on-white.png]]
borders @@ negative
# resize things to fit the 'earth' background
pop :: $earth.r # the '$' preserves the total population
borders :: earth.r
borders *= 6 # brighten the lines
# lighten the background
earth.r += 0.6
earth.g += 0.6
earth.b += 0.6
# show the borders in white
earth.r >= borders
earth.g >= borders
earth.b >= borders
# show the population in black
pop /= 800000 # max people per pixel
pop @@ spread
pop @@ negative
earth.r <= pop
earth.g <= pop
earth.b <= pop
# save
earth >> data/population-earth1.png