The heart and soul of the ImageKit library, ImageSpecField allows you to add variants of uploaded images to your models.
Parameters: |
|
---|
ProcessedImageField is an ImageField that runs processors on the uploaded image before saving it to storage. This is in contrast to specs, which maintain the original. Useful for coercing fileformats or keeping images within a reasonable size.
The ProcessedImageField constructor accepts all of the arguments that the django.db.models.ImageField constructor accepts, as well as the processors, format, and options arguments of imagekit.models.ImageSpecField.
Imagekit image processors.
A processor accepts an image, does some stuff, and returns the result. Processors can do anything with the image you want, but their responsibilities should be limited to image manipulations–they should be completely decoupled from both the filesystem and the ORM.
Add a border of specific color and size to an image.
Parameters: |
|
---|
Resizes an image to the specified width and height.
Parameters: |
|
---|
Resizes the canvas, using the provided background color if the new size is larger than the current image.
Parameters: |
|
---|
Resizes the image to the smallest possible size that will entirely cover the provided dimensions. You probably won’t be using this processor directly, but it’s used internally by ResizeToFill and SmartResize.
Parameters: |
|
---|
Resizes an image, cropping it to the exact specified width and height.
Parameters: |
|
---|
Resizes an image to fit within the specified dimensions.
Parameters: |
|
---|
The SmartResize processor is identical to ResizeToFill, except that it uses entropy to crop the image instead of a user-specified anchor point. Internally, it simply runs the ResizeToCover and SmartCrop processors in series.
Parameters: |
|
---|
Crops an image, cropping it to the specified width and height. You may optionally provide either an anchor or x and y coordinates. This processor functions exactly the same as ResizeCanvas except that it will never enlarge the image.
Crop an image to the specified dimensions, whittling away the parts of the image with the least entropy.
Parameters: |
|
---|
Calculate the entropy of two slices (from the start and end of an axis), returning a tuple containing the amount that should be added to the start and removed from the end of the axis.
Trims a color from the sides of an image.
Parameters: |
|
---|
A convenience utility for adding thumbnails to Django’s admin change list.
Parameters: |
|
---|