Programmable Media

Upload with the CLI (video tutorial)

Last updated: Sep-12-2024

Overview

Watch this tutorial learn how to use the CLI to create an upload preset to transform your images upon upload.

Video tutorial


This video is brought to you by Cloudinary's video player - embed your own!

Tutorial contents

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

Remove the image backgrounds during upload to Cloudinary

Jump to this spot in the video  0:05 Using an upload preset, you can transform your images during upload to Cloudinary.

Create an upload preset with the CLI to remove background images

Jump to this spot in the video  0:13 Use the create_upload_preset command to create an upload preset that invokes the Cloudinary AI Background Removal add-on (background_removal=cloudinary_ai).
The upload preset also uses the original filename as the public ID (use_filename=true unique_filename=false) and ensures an existing file with the same public ID is not overwritten (overwrite=false).
cld admin create_upload_preset name=remove_background overwrite=false use_filename=true unique_filename=false type=upload access_mode=public background_removal=cloudinary_ai

Upload the images to Cloudinary

Jump to this spot in the video  0:41 Use the upload_dir command to upload the images with the newly created upload preset.
cld upload_dir -f new_toys -p remove_background soft_toys

View the new folder in the Media Library

Jump to this spot in the video  0:52 The new folder contains the uploaded images without backgrounds.

Keep learning

Related topics

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

Get Started with the CLI
Set up the CLI and get familiar with some basic commands
Scripting with the CLI
Use a script to create an animated GIF
Get Creative with the CLI
Create an image sprite from pages of a PDF

 

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: