Resize images with PHP script

Did you ever try to resize many images at once? I did, and I wrote PHP script for that purpose. Anyway, after I selected few images from my photo album, I realized that every image was about 500KB and resolution of 1600×1200. This seems too big. Images should be smaller and lighter for upload.