

To use this feature, make sure to pass S3 config when instantiating the ImageOptim class or set it before calling the function.Ĭonst IMAGE_OPTIM_QUALITY = const IMAGE_OPTIM_MULTIPLY = const IMAGE_OPTIM_CROP = const IMAGE_OPTIM_FORMAT = const optionSchema = Joi. Further, this API can generate images specifically tuned for high-DPI screens and compressive images. Will upload to ImageOptim, upload the compressed image to S3, and return the S3 path. ImageOptim API is a web service for image compression that helps you to easily resize and optimize images on your server. options - Object - (optional) see the details belowĬompressAndSaveToS3(imageSource,, s3param, filename).
#Imageoptim api for mac#
Automates ImageOptim, ImageAlpha, and JPEGmini for Mac to make batch optimisation of images. Promise, if resolved will return buffer of compressed image, otherwise error will be returned. A minimal client for ImageOptims JPEG compression HTTP API. Will upload to ImageOptim and return the buffer of the compressed image. filename - String - required only if imageSource is bufferĬompressAndSaveToBuffer(imageSource,, filename).options - Object - see the details below.imageSource - String/ Buffer - either URL, file path, or buffer of an image.
#Imageoptim api code#
