It may seem counter-intuitive to use anything other than CSS or PhotoShop to resize images: why on earth would you rescale an image with a server-side technique when the same could be done easily and quickly with a modification to the image’s width and height in your code?
The need for a server-side image resize will often occur when you are interacting with a service external to your own site: an API that requests an image in a particular size and format, for example. Another possibility is file uploads: if you allow users to upload images to your site, you’ll want to be sure they are scaled and cropped to specific dimensions. Under such circumstances, CSS is useless: the image must be the right size and format before it is used. Another good example is social media sites’ request for a thumbnail image to associate with a web page or blog post, during a “share” or “like” action.
Read more about PHP Image Resize