Newbie here. Shadows possible?
Is there a way to automate extraction of images and adding shadows back into the files? I do volume photography for sports. I am looking to automate the process a bit. I extract my subjects and then have to manually place shadows for my subject to look grounded.
Answers
-
Hi,
The assets that are uploaded to your Media Library account could be accessed through the delivery URL (see https://cloudinary.com/documentation/transformation_reference#overview):
https://res.cloudinary.com/<cloud_name>/<asset_type>/<delivery_type>/<transformations>/<version>/<public_id_full_path>.<extension>
And you may use the e_background_removal parameter that is chained together with the e_dropshadow parameter. For example:
Original: https://res.cloudinary.com/demo/image/upload/docs/lipstick
Using background removal: https://res.cloudinary.com/demo/image/upload/e_background_removal/docs/lipstick
Together with the dropshadow: https://res.cloudinary.com/demo/image/upload/e_background_removal/e_dropshadow/docs/lipstick
Note that you could add the transformation parameters to each of your asset's delivery URL.
Hope this helps. Please let me know if you have any further questions.
Best regards,
Eric
0 -
Thank you for the response. Am I correct in saying that I need to set up SDK to run batch processes here? I understand you have to create the transcription. It is not working on individual images, error message says its working in the background.
0 -
Hi @AlyReid,
The Cloudinary AI Background removal addon supports two types of uses:
- Via the effect => background_removal (
e_background_removal
URL transformation) - https://cloudinary.com/documentation/cloudinary_ai_background_removal_addon#removing_the_background_on_the_fly - Via the
background_removal
parameter during upload()/update() - https://cloudinary.com/documentation/cloudinary_ai_background_removal_addon#removing_the_background_on_upload_update
Background removal is an asynchronous process which means once we receive a request, via any of the 2 approaches mentioned above, a background task is scheduled to process the background removal of the asset.
When using the
e_background_removal
parameter (1) to create a derived/transformed version of an original you will receive an HTTP 423 error indicating that the processing will continue in the background and if you refresh the same URL after a number of seconds, you should receive the background removed versions once the asynchronous task has completed. This transformation does not affect the original image in your cloud - so if that contains a background then it won't change - instead, this creates a new derived/transformed version of the original with the background removed.If you request background removal as part of the upload of a new image (2) then the original image will be initially stored in your cloud as-is (with the background) and the asynchronous process to remove the background will be scheduled. Once that runs, we will replace the previous original image with the background with the output image post-background-removal. The original image (with background) will be stored as a backup copy and you can recover it via the API or Media Library UI.
If you want the original image in your Cloudinary account to have its background removed then you will want to use the upload() method (https://cloudinary.com/documentation/image_upload_api_reference#upload) and request background_removal upon upload for new images. For existing images, you can replace them with the background removed version of themselves by triggering the background_removal addon using the update() (https://cloudinary.com/documentation/admin_api#update_details_of_an_existing_resource) method of the Admin API.
Otherwise, you can keep the original image as-is (with background) and dynamically (on the fly) create a derived/transformed version of that original by performing the background removal on-the-fly using the
e_background_removal
transformation.0 - Via the effect => background_removal (