“There are more people living inside this circle than outside of it”, with an actual circle

Add to Facebook download .zip with all pictures

Thought about Google Maps API, but AFAIK Google Map only does Mercator. Decided to learn how GMT works.

Tracked down OP’s source using Tineye. It’s [from NASA, via Wikimedia Commons](https://en.wikipedia.org/wiki/File:Winkel-tripel-projection.jpg).

Used the following script to generate a plain white map with the circle in black, plus a few marks to help with alignment later:

#!/bin/sh

# Generate map with countries and coasts
#pscoast -N1/2 -Rd -JR8i -G150/255/170 -B45g60 -K > map.ps

# “Map” with only grid and border
#psbasemap -Rd -JR8i -B45g60 -K > map.ps

# Generate blank “map”. 8 inches across
psbasemap -G -Rd -JR8i -K > map.ps

# Draw filled, black circles
psxy -R -J -SE -O -G0/0/0 << EOF >> map.ps
106.6 26.6 0 8200 8200
# Extra points for alignment
0 0 0 50 50
-90 0 0 50 50
-90 -45 0 50 50
0 -45 0 50 50
90 -45 0 50 50
-90 45 0 50 50
0 45 0 50 50
-179.9 0 0 20 20
179.9 0 0 20 20
EOF

# Convert to PNG at 256PPI (256PPI * 8 inches == 2048 pixels == target width)
ps2raster map.ps -A -E256 -Tg -Qg

# Finished

This generates “map.png”, with (almost) the exact same horizontal resolution as the image from Commons. I used the commented-out pscoast line to generate a map with coasts and borders, so I could see what I was doing while I was playing with the position of the circle, then switched to the current psbase command in the final run to generate a totally blank “map”, with only my circle and some small dots for alignment overlaid.

Opened the Commons image in GIMP. Made two layers, with the plain image as the background, and an inverted copy of it on top. Added map.png as the alpha channel of the inverted layer (reversed, if I recall correctly). Used the extra dots to confirm the images were aligned properly (they fall on the grid intersections of the Commons image), then removed them.

Using map.png as the alpha-mask for the inverted copy allows the non-inverted image to show through everywhere except inside the circle.

EDIT: Realised this might look kind of intimidating. Although it’s formatted as a Unix shell script (because that’s what I was using), the only magic is in the GMT commands, and it ought to work just the same on Windows (if you want to make a batch file, you’ll need to fix the comments; Bourne shell comments start with “#”, I think .bat uses “rem”). The GIMP stuff would work very similarly in Photoshop or any layered image editor.

EDIT2: Forgot that this uses the << input redirection. That will need fixing in Windows. Easiest would be to put the points in a text file, and do psxy -R -J -SE -O -G0/0/0 < filename.txt

Latest Comments
  1. southwickship5 December 29, 2016
  2. Nyest December 29, 2016
  3. BuenaShore December 4, 2016
  4. CristineLacomb November 22, 2016
  5. Phois November 17, 2016
  6. Phois November 11, 2016
  7. Nitanen November 7, 2016
  8. southwickship5 October 31, 2016
  9. poissonman88 October 21, 2016
  10. Rac October 16, 2016
  11. Imem October 2, 2016
  12. AdalbertoHumes September 25, 2016
  13. TakakoMelnick September 23, 2016
  14. AdalbertoHumes September 13, 2016
  15. Hinoldo September 11, 2016
  16. Yuania September 11, 2016
  17. Rosybi September 2, 2016
  18. Ensulard September 1, 2016
  19. Nitanen August 27, 2016
  20. deardorff3 August 26, 2016
  21. Nyem August 24, 2016
  22. Issdar August 20, 2016
  23. Sulghaeng August 19, 2016
  24. Odynu August 18, 2016
  25. LeonardEdlund August 2, 2016
  26. sarkisian93 July 28, 2016
  27. Emn July 27, 2016
  28. ShahidAqq July 25, 2016
  29. Oughumde July 17, 2016
  30. Burageorm July 6, 2016
  31. Usklor June 30, 2016
  32. Kimny June 7, 2016
  33. Dokeg June 5, 2016
  34. deardorff3 June 1, 2016
  35. Korah May 20, 2016
  36. Yonys May 19, 2016
  37. LacyMaberry May 17, 2016
  38. Rynepi May 11, 2016
  39. Uskunte May 8, 2016
  40. walters1981 May 6, 2016
  41. Nitanen May 1, 2016
  42. Usklor April 28, 2016
  43. tauskny April 25, 2016
  44. TyroneVautour April 18, 2016
  45. Tabelque April 9, 2016
  46. Emn April 3, 2016
  47. Awust March 25, 2016
  48. Undihin March 22, 2016
  49. ShahidAqq March 8, 2016
  50. Ingn March 8, 2016
  51. brusswszech March 1, 2016
  52. Lordnys February 22, 2016
  53. Cerlory February 21, 2016
  54. uruch February 20, 2016
  55. Lordnys February 14, 2016
  56. TyroneVautour February 5, 2016
  57. Jacquiline1999 February 2, 2016
  58. Usklor January 30, 2016
  59. Whail January 29, 2016
  60. Dotuton January 25, 2016
  61. poissonman88 January 25, 2016
  62. milonekilone4 January 20, 2016
  63. goodellkol January 13, 2016
  64. Oasi January 11, 2016
  65. swedberg January 7, 2016
  66. Ingn December 31, 2015
  67. Iworo December 28, 2015
  68. hobbyrobie186 December 26, 2015
  69. Nulad December 22, 2015
  70. Queighty December 20, 2015
  71. Uskunte December 19, 2015
  72. vanderpool39 December 16, 2015
  73. ucid December 11, 2015
  74. Lavonne1 December 5, 2015
  75. osade December 2, 2015
  76. BuenaShore November 28, 2015
  77. Queighty November 12, 2015
  78. Mylil November 11, 2015
  79. EloyVanostrand November 1, 2015
  80. Neab October 23, 2015
  81. Nyem October 20, 2015
  82. Eldoq October 17, 2015
  83. goodellkol October 3, 2015
Comments are closed.
Click on Like Page, to get new amazing photo every day on facebook.
Thanks! I already Like.