How to Emboss Images using Python
When we talk about digitally embossing an image, we’re referring to a visual effect which emulates the centuries-old physical embossment process (creating raised surfaces on physical objects for an enhanced look & feel). Even without a tactile element, this visual effect still holds weight in a digital environment, bringing a classic and distinguished look to the subjects of an image.
The API solution provided below makes it simple to perform this operation on an image seamlessly within your Python workflow. You just need to install the SDK and copy & paste ready-to-run Python code snippets, and you’re good to go.
First, run the below command to install the Python SDK:
pip install cloudmersive-image-api-client
Next, include the imports and call the function:
from __future__ import print_function
from cloudmersive_image_api_client.rest import ApiException
from pprint import pprint
# Configure API key authorization: Apikey
configuration = cloudmersive_image_api_client.Configuration()
configuration.api_key['Apikey'] = 'YOUR_API_KEY'
# create an instance of the API class
api_instance = cloudmersive_image_api_client.FilterApi(cloudmersive_image_api_client.ApiClient(configuration))
radius = 56 # int | Radius in pixels of the emboss operation; a larger radius will produce a greater effect
sigma = 56 # int | Sigma, or variance, of the emboss operation
image_file = '/path/to/inputfile' # file | Image file to perform the operation on. Common file formats such as PNG, JPEG are supported.
# Emboss an image
api_response = api_instance.filter_emboss(radius, sigma, image_file)
except ApiException as e:
print("Exception when calling FilterApi->filter_emboss: %s\n" % e)
Each request to this API will need to specify the radius and sigma (variance) of the embossment operation. Beyond that, you’ll just need your file path and API key (register a free account here to get one), and you’re good to go.