Image Processing URL
Arvan Image processes images through the URL. You send an HTTP GET request to Arvan Image, and the service responds with a processed image file and a Content-Type: image header.
URL Structure
https://your-subdomain.arvanimage.ir/{id}/{processing options}/v1/{file path}[.{output extension}]
Example:
https://acme.arvanimage.ir/brandkit/c_fill,w_300,h_400,g_center/e_brightness:20/e_blur:100/q_80/v1/products/photo.jpg.webp
This URL crops the image to 300×400, applies center gravity, increases the brightness, blurs the image, sets the quality to 80, and outputs WebP.
Processing Options
Resizing and Cropping
c_<type>
Specifies how the image is resized or cropped.
| Value | Behavior |
|---|---|
fit | Fits the image inside the frame while keeping its aspect ratio |
fill | Enlarges the image while keeping its aspect ratio until it fills the frame, and crops the excess |
scale | Stretches the image to exactly the given dimensions |
limit | Like fit, but prevents enlargement |
lfill | Like fill, but prevents enlargement |
crop | Cuts a rectangular area with the given dimensions from the image |
pad | Fits the image inside the frame while keeping its aspect ratio, and fills the empty space with the background color |
lpad | Like pad, but prevents enlargement |
Examples:
# fit
https://acme.arvanimage.ir/brandkit/c_fit,w_800,h_600/v1/products/photo.jpg
# fill
https://acme.arvanimage.ir/brandkit/c_fill,w_300,h_400/v1/products/photo.jpg
# scale
https://acme.arvanimage.ir/brandkit/c_scale,w_800,h_600/v1/products/photo.jpg
# limit
https://acme.arvanimage.ir/brandkit/c_limit,w_800,h_600/v1/products/photo.jpg
# lfill
https://acme.arvanimage.ir/brandkit/c_lfill,w_300,h_400/v1/products/photo.jpg
# crop
https://acme.arvanimage.ir/brandkit/c_crop,w_300,h_300/v1/products/photo.jpg
# pad
https://acme.arvanimage.ir/brandkit/c_pad,w_800,h_600/v1/products/photo.jpg
# lpad
https://acme.arvanimage.ir/brandkit/c_lpad,w_800,h_600/v1/products/photo.jpg
Width and Height
w_<value>
h_<value>
Specify the output width and height in pixels.
Example:
https://acme.arvanimage.ir/brandkit/c_fit,w_800,h_600/v1/products/photo.jpg
Aspect Ratio
ar_<width>:<height>
ar_<decimal>
Specifies the output aspect ratio. It must be used together with w_ or h_.
Examples:
# 16:9 ratio with width set
https://acme.arvanimage.ir/brandkit/c_fill,w_800,ar_16:9/v1/products/photo.jpg
# 1.5 ratio with height set
https://acme.arvanimage.ir/brandkit/c_fit,h_600,ar_1.5/v1/products/photo.jpg
Gravity
g_<position>
Specifies the position of the image when cropping.
Allowed values: center, north, south, east, west, north_east, north_west, south_east, and south_west.
Examples:
# Center
https://acme.arvanimage.ir/brandkit/c_fill,w_400,h_400,g_center/v1/products/photo.jpg
# Top
https://acme.arvanimage.ir/brandkit/c_fill,w_400,h_400,g_north/v1/products/photo.jpg
# Bottom right
https://acme.arvanimage.ir/brandkit/c_fill,w_400,h_400,g_south_east/v1/products/photo.jpg
Crop Point Offset
x_<value>
y_<value>
These options can only be used together with c_crop.
Example:
https://acme.arvanimage.ir/brandkit/c_crop,w_400,h_400,x_30,y_-20/v1/products/photo.jpg
Quality
q_<value>
Sets the output quality from 1 to 100.
Example:
https://acme.arvanimage.ir/brandkit/q_80/v1/products/photo.jpg.webp
Rotation
a_<angle>
Rotates the image by an angle that is a multiple of 90.
Example:
https://acme.arvanimage.ir/brandkit/a_90/v1/products/photo.jpg
Flipping the Image
a_hflip
a_vflip
Examples:
# Horizontal flip
https://acme.arvanimage.ir/brandkit/a_hflip/v1/products/photo.jpg
# Vertical flip
https://acme.arvanimage.ir/brandkit/a_vflip/v1/products/photo.jpg
Background
b_rgb:<hex_color>
Specifies the output background color.
Example:
https://acme.arvanimage.ir/brandkit/c_pad,w_800,h_600/b_rgb:FC41CB/v1/products/photo.png
DPR
dpr_<value>
Specifies the output DPR (device pixel ratio).
Example:
https://acme.arvanimage.ir/brandkit/c_fit,w_800,h_600/dpr_2/v1/products/photo.jpg
Filters
blur
e_blur
e_blur:<strength>
Examples:
# Default value
https://acme.arvanimage.ir/brandkit/e_blur/v1/products/photo.jpg
# strength of 200
https://acme.arvanimage.ir/brandkit/e_blur:200/v1/products/photo.jpg
sharpen
e_sharpen
e_sharpen:<strength>
Examples:
https://acme.arvanimage.ir/brandkit/e_sharpen/v1/products/photo.jpg
https://acme.arvanimage.ir/brandkit/e_sharpen:200/v1/products/photo.jpg
pixelate
e_pixelate
e_pixelate:<size>
Examples:
https://acme.arvanimage.ir/brandkit/e_pixelate/v1/products/photo.jpg
https://acme.arvanimage.ir/brandkit/e_pixelate:12/v1/products/photo.jpg
Brightness
e_brightness:<level>
Example:
https://acme.arvanimage.ir/brandkit/e_brightness:20/v1/products/photo.jpg
Contrast
e_contrast:<level>
Example:
https://acme.arvanimage.ir/brandkit/e_contrast:-15/v1/products/photo.jpg
Saturation
e_saturation:<level>
Example:
https://acme.arvanimage.ir/brandkit/e_saturation:25/v1/products/photo.jpg
Grayscale
e_grayscale
Example:
https://acme.arvanimage.ir/brandkit/e_grayscale/v1/products/photo.jpg
Removing a Solid Background
e_trim
e_trim:<tolerance>
e_trim:<tolerance>:rgb:<hex_color>
Examples:
# Default tolerance
https://acme.arvanimage.ir/brandkit/e_trim/v1/products/logo.png
# tolerance of 10
https://acme.arvanimage.ir/brandkit/e_trim:10/v1/products/logo.png
# Remove white background
https://acme.arvanimage.ir/brandkit/e_trim:10:rgb:FFFFFF/v1/products/logo.png
Additional Options
Resizing Type
ip_resizing_type:<type>
Example:
https://acme.arvanimage.ir/brandkit/ip_resizing_type:fill/v1/products/photo.jpg
Enlarge
ip_enlarge:<value>
Example:
https://acme.arvanimage.ir/brandkit/ip_enlarge:1/v1/products/photo.jpg
Minimum Dimensions
ip_min_width:<value>
ip_min_height:<value>
Example:
https://acme.arvanimage.ir/brandkit/ip_min_width:300,ip_min_height:200/v1/products/photo.jpg
Zoom
ip_zoom:<x>
ip_zoom:<x>:<y>
Examples:
https://acme.arvanimage.ir/brandkit/ip_zoom:1.5/v1/products/photo.jpg
https://acme.arvanimage.ir/brandkit/ip_zoom:1.5:2/v1/products/photo.jpg
Extending the Image
ip_extend:<value>[:<gravity>[:<x>:<y>]]
Examples:
https://acme.arvanimage.ir/brandkit/ip_extend:1/v1/products/photo.jpg
https://acme.arvanimage.ir/brandkit/ip_extend:1:center:10:20/v1/products/photo.jpg
Extending by Aspect Ratio
ip_extend_aspect_ratio:<value>[:<gravity>[:<x>:<y>]]
Example:
https://acme.arvanimage.ir/brandkit/ip_extend_aspect_ratio:1:center/v1/products/photo.jpg
Advanced Gravity
ip_gravity:<type>[:<x>:<y>]
Examples:
https://acme.arvanimage.ir/brandkit/ip_gravity:ce/v1/products/photo.jpg
https://acme.arvanimage.ir/brandkit/ip_gravity:fp:0.33:0.5/v1/products/photo.jpg
Advanced Cropping
ip_crop:<width>[:<height>[:<gravity>[:<x>:<y>]]]
Example:
https://acme.arvanimage.ir/brandkit/ip_crop:400:400:ce/v1/products/photo.jpg
Advanced Background Removal
ip_trim:<threshold>[:<hex_color>[:<equal_h>:<equal_v>]]
Example:
https://acme.arvanimage.ir/brandkit/ip_trim:10:FFFFFF:1:1/v1/products/logo.png
Padding
ip_padding:<top>[:<right>:<bottom>:<left>]
Examples:
https://acme.arvanimage.ir/brandkit/ip_padding:10/v1/products/photo.png
https://acme.arvanimage.ir/brandkit/ip_padding:10:20:15:5/v1/products/photo.png
Auto-Rotation Based on EXIF
ip_auto_rotate:<value>
Example:
https://acme.arvanimage.ir/brandkit/ip_auto_rotate:1/v1/products/photo.jpg
Direct Filters
ip_blur:<sigma>
ip_sharpen:<sigma>
ip_pixelate:<size>
Example:
https://acme.arvanimage.ir/brandkit/ip_blur:10,ip_sharpen:5,ip_pixelate:8/v1/products/photo.jpg
Watermark
ip_watermark:<opacity>[:<position>:<x>:<y>:<scale>]
Examples:
https://acme.arvanimage.ir/brandkit/ip_watermark:0.5/v1/products/photo.jpg
https://acme.arvanimage.ir/brandkit/ip_watermark:0.5:se:10:10:0.25/v1/products/photo.jpg
Metadata
ip_strip_metadata:<value>
ip_keep_copyright:<value>
ip_strip_color_profile:<value>
ip_preserve_hdr:<value>
Example:
https://acme.arvanimage.ir/brandkit/ip_strip_metadata:1,ip_keep_copyright:0,ip_strip_color_profile:1,ip_preserve_hdr:0/v1/products/photo.jpg
Embedded Thumbnail
ip_enforce_thumbnail:<value>
Example:
https://acme.arvanimage.ir/brandkit/ip_enforce_thumbnail:1/v1/products/photo.jpg
Quality by Format
ip_format_quality:<format>:<quality>[:<format>:<quality>...]
Example:
https://acme.arvanimage.ir/brandkit/ip_format_quality:webp:80:jpg:75/v1/products/photo.jpg.webp
Maximum Output Size
ip_max_bytes:<bytes>
Example:
https://acme.arvanimage.ir/brandkit/ip_max_bytes:200000/v1/products/photo.jpg.webp
Output Format
The output format is set by the extension at the end of the file path:
# Keep the original format
https://acme.arvanimage.ir/brandkit/v1/products/photo.jpg
# Convert JPG to WebP
https://acme.arvanimage.ir/brandkit/v1/products/photo.jpg.webp
# Convert PNG to AVIF
https://acme.arvanimage.ir/brandkit/v1/products/photo.png.avif