Function Order

Function Order

Problem

Image quality is not as good as expected, or else the processing of images is taking too long.

Description

For a satisfactory user experience, a website should find a balance between quality graphics and a quick download time. The most efficient order of functions should be used wherever possible, while maintaining a certain degree of image quality. Conversely, if image quality is the prime concern, functions can be performed in an order that will help maintain that quality but this quality will be accompanied by a longer processing time.

Solution/Discussion

By having functions performed in a certain order, a script can be optimized for either higher image quality, or for efficiency in processing. It is unlikely that all of the functions found in the following two lists will be used in any one script…they are meant to be used as guidelines. The following lists assume that the starting image data is 24- or 32-bit.

Processing for speed:
  • collapse()
  • crop()
  • composite()
  • scale()
  • rotate()
  • (filters, transforms & color space adjustments: colorize(), adjustRgb(), etc.)
  • reduce() or convert()
Processing for quality:
  • composite()
  • crop()
  • (filters, transforms & color space adjustments: colorize(), adjustRgb(), etc.)
  • rotate()
  • scale()
  • collapse()
  • reduce() or convert()
Back to Developer Resources

MediaRich Brochure

Equilibrium Solutions Brochure