That function is part of the gd library package. You'll need to download gd, and the jpeg library to use that function. Works pretty well from what I have used it for but I don't like giving the web server write access, which it needs to write the image it creates to a file.