Define an API function that processes images of any size. Call the API with URLRead and display the result.
Define an API function
Define an APIFunction, which takes an image and creates a stylized version:
Deploy the API
Using CloudDeploy, deploy the API function to the cloud with public permissions (everyone can use this API):
Get an image
Use WebImageSearch to find an image of a bird and resize it with ImageResize:
Create an HTTP request
Use HTTPRequest to define a multipart "POST" request for the Wolfram Cloud API server:
Submit the request
Here URLRead will execute the request and return the result as an HTTPResponse:
Import the result
Use ImportByteArray to import the bytes from the response as a PNG image:
- ImportByteArray imports the bytes and takes care of the transformation of those bytes in the format specification.