title: Optimizing images for web
body: <p>I have a lot of jpeg images which I want to optimize for web but I need a process which can also be done for incoming images in real time.  In other words I don't want to use a service like Smush.it or drop them into photoshop for manipulation but I do want to know what I can do in php.  I would prefer a solution which only requires php image processing functions but if necessary and it would provide significant improvement then a command line tool like jpegcrush could be used as well.</p>
  
  <p>I have read that simply by making the image in php the EXIF data is stripped.  What other things can I do without degrading the actual quality?  When I save in photoshop using the 'save for web' feature, the savings are significant without a noticeable quality loss so I was wondering if anyone knew exactly what operations are done in there.  One other thing I have noticed is that images from youtube are normally much larger area-wise than they need to be but they have very small file sizes... does anyone know what is going on there or is this some secret technique?</p>
  
  <p>If it makes any difference the images I am working with are mostly 320x320 and I want to make them progressive jpg.  Thanks in advance.</p>