Courses‎ > ‎Computer Graphics‎ > ‎Konstantinovich‎ > ‎

2019-01-31 Work 0

posted Jan 31, 2019, 11:03 AM by Konstantinovich Samuel   [ updated Feb 6, 2019, 10:01 AM ]

Time for your first computer generated image:


Make a repo:
mks66-picmaker

In the language of your choice:
  • Develop your code in the appropriately named repo on github.
  • Create a program that generates a valid ppm image file, it should be at least 500x500, but also don't make it too big (remember, each pixel is stored as up to 9 bytes - 3 for each color value - so a 1000x1000 image could be 9MB large, they get big fast).
  • Convert your image to a png and upload it to the ML6 gallery website: http://gallery.stuycs.org
    • For help with converting, you should install ImageMagick
      • on ubuntu, apt-get install imagemagick will work
      • on mac: 
        • First install XQuartz form here: https://www.xquartz.org/index.html
        •  (if you have homebrew installed): brew install imagemagick --with-x11 will work ( the --with-x11 flag is very necessary, and I've already spent the hours yelling at the internet trying to figure out what was wrong.)
        • If you're more of a macports kind of person: port install imagemagick
      • on windows... installing ubuntu and running apt-get install imagemagick will work (I've been told imagemagick works on cygwin)
      • for more detailed instructions (including building and installing it on your own): http://www.imagemagick.org/script/binary-releases.php
      • You can also log into any stuy machine remotely, and run convert on them.
      • Once you've installed image magic, you can convert with the following command:
        • convert <source> <destination>
        • The destination format will be automatically set based on the file extension
        • example: convert foo.ppm foo.png


Comments