Whatever message this page gives is out now! Go check it out!

Compressing JPEG images

Last update:
May 18, 2026
To reduce the size of large files, you can convert a JPEG file to a lower quality image by using the write action of the cfimage tag. Specify a value between 0 (low) and 1 (high) for the quality attribute, as the following example shows:
<cfimage source="../cfdocs/images/artgallery/jeff05.jpg" action="write" 
 destination="jeff05_lq.jpg" quality="0.5" overwrite="yes">
You can perform the same operation by using the ImageWrite function:
<cfset myImage=ImageNew("jeff05.jpg")> 

<cfset ImageWrite(myImage,"jeff05_lq.jpg","0.5")>

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page