Sometimes the little improvements make all the difference. Lately we've added a few small but useful features requested by our customers, namely Upscale Lock, Crop, and Format.
If it so happens that you want your image to be no more than, say, 100 pixels wide, but it could be less, then this option may help you. Setting
upscale=false will prevent an image being scaled up. So using the setting
width=100&upscale=false would pass through any image less than 100 pixels wide, but resize any that are bigger.
Often you want to show just part of an image - for instance you may allow your users to select a cropped rectangle of the avatar image they upload. To save you having to write this code yourself, LibPixel can crop images during processing.
To crop an image, you specify four parameters – the origin x and y (which defines the top left of the crop rectangle) and the dimensions w and h (which define the size of the rectangle).
Note that the crop values refer to the dimensions of the image before it has been resized (if you are also resizing).
What if you allow your users to upload in any format, such as PNG or GIF, but to save bandwidth you want to always deliver JPEGs of a particular quality?
Normally images are processed and presented in the same format as the input image, but you can now force images to be output as jpeg, png or webp, using
Three small features, but perhaps they are just what you were looking for.