File:population-earth1.png: Difference between revisions

(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).)
 
Line 5: Line 5:


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).
==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