Programmable Media

Optimize Images in SolidJS with Cloudinary (video tutorial)

Last updated: Feb-26-2024


Learn how to optimize images in SolidJS using the Cloudinary js-url-gen library.

Video tutorial

View the code
You can find the code from this tutorial in GitHub.

Tutorial contents

This tutorial presents the following topics. Click a timestamp to jump to that part of the video.

Use Cloudinary to deliver images in SolidJS

Jump to this spot in the video  0:00 SolidJS is designed for speed, and it's crucial that your images load just as quickly. Learn how to utilize Cloudinary's URL-Gen SDK to set up, optimize, and transform images in SolidJS.

Use the Cloudinary URL-Gen SDK in SolidJS

Jump to this spot in the video  0:17 The Cloudinary URL-Gen SDK is versatile and can be integrated into any JavaScript app or framework. To use it with SolidJS, install the SDK, import it into your project, and then set up a new Cloudinary instance. Begin transforming Cloudinary URLs by updating your existing image src prop to {cld.image(<public id>).toURL()}.

Apply Cloudinary optimizations

Jump to this spot in the video  1:12 Optimize your images by chaining the quality option with the value "auto" for Automatic Quality Selection. Then, chain the format option, also set to "auto," for Automatic Format Selection.

Add image transformations

Jump to this spot in the video  1:56 Enhance your image optimization by adding transformations. Import the scale action and chain the resize transformation to set the image width to 1200px and height to 800px. You can take this a step further by utilizing Cloudinary's Responsive Images solution.

Keep learning

Related topics

If you like this, you might also like...

Optimization Tips
Tips for delivering optimized images
Optimize Images with Nuxt
Optimize images in Nuxt with Nuxt Cloudinary
Content-aware Video Cropping
Smartly crop a video using content-aware AI


Cloudinary Academy


Check out the Cloudinary Academy for free self-paced Cloudinary courses on a variety of developer or DAM topics, or register for formal instructor-led courses, either virtual or on-site.


✔️ Feedback sent!

Rate this page: