PPMFile saves the output in binary format.
PPMFile saves the output in binary format.

--- a/PPMFile.cpp
+++ b/PPMFile.cpp
@@ -165,14 +165,14 @@
 
 void PPMFile::save(std::string filename)
 { 
-  std::ofstream fh(filename.c_str());
+  std::ofstream fh(filename.c_str(),std::ios::binary|std::ios::out);
   if(!fh.is_open())
     {
       std::cerr << "Error saving PPM file: " << filename << std::endl;
       return;
     }
 
-  fh << "P3" << std::endl;
+  fh << "P6" << std::endl;
   fh << _width << " " << _height << std::endl;
 
 
@@ -193,11 +193,14 @@
 	  if(g>1) g=1;
 	  double b=_pixels[x][y].b();
 	  if(b>1) b=1;
-	  fh << (unsigned int)(r*scale) << " "
+	  /*fh << (unsigned int)(r*scale) << " "
 	     << (unsigned int)(g*scale) << " "
-	     << (unsigned int)(b*scale) << "\t";
-	}
-      fh << std::endl;
+	     << (unsigned int)(b*scale) << "\t";*/
+	  fh << (char)(r*scale)
+	     << (char)(g*scale)
+	     << (char)(b*scale);
+	}
+      //fh << std::endl;
     }
 
   fh.close();