Skip to content

Color Levels

By , Customer Success DirectorUpdated

Open this page in a new chat

Short answer

Color levels correct the tonal range of an image from its URL. Set colorlevel.white from 1 to 255 (default 255) and colorlevel.black from 0 to 254 (default 0), alone or together. Raising the white level can turn an off-white product background pure white. Add histogram=rgb to see the image's tonal range as a chart.

After reading this you will know

  • How to set the white and black levels of an image
  • How to get a pure white background for product photos
  • How to show an image's histogram

Fix the tonal range and color balance of an image by adding colorlevel options to its URL. Try them in the demo below.

Try it
Original imageImage with the options appliedOriginalWith options
215
30
https://demo.sirv.com/salomon.jpg?colorlevel.white=215&colorlevel.black=30

colorlevel.white is set on a scale from 1 to 255, where 255 is the default.

White level increased

https://demo.sirv.com/rocky.jpg?colorlevel.white=204

colorlevel.black is set on a scale from 0 to 254, where 0 is the default.

Black level increased

https://demo.sirv.com/rocky.jpg?colorlevel.black=43

Black and white levels can be applied at the same time:

Black and white levels changed

https://demo.sirv.com/rocky.jpg?colorlevel.white=204&colorlevel.black=43

Levels can be used to obtain pure white backgrounds, desirable for ecommerce product photography.

Below, Sirv turns an off-white background to pure white. Then it shows an automatically cropped version, using Sirv’s autocrop feature:

Original image

Original

Increased white levels

Increased white levels

Autocrop and white levels

White levels and autocrop

https://demo.sirv.com/caviar.jpg?w=250&q=90

https://demo.sirv.com/caviar.jpg?w=250&q=90&colorlevel.white=200&colorlevel.black=9

https://demo.sirv.com/caviar.jpg?w=250&q=90&colorlevel.white=200&colorlevel.black=9&autocrop=true

Sirv can generate a histogram of your image, to help you understand its tonal range. It analyses each pixel of your image and plots it as a chart.

The chart’s numerical range goes from 0-255, counting pixels of 0 as totally black and pixels of 255 as totally white.

histogram can be set as rgb (for red, green and blue), or any of r/g/b separately.

Histogram of RGB colors

https://demo.sirv.com/rocky.jpg?histogram=rgb

Back to top