Images are widely used to represent information. Considering the demand and requests, we have introduced a most awaited feature of image to grayscale conversion in Aspose.Imaging Cloud API February 2020 release.
You can convert, edit or manipulate BMP, GIF, JPEG, PSD, TIFF, WEBP, PNG, and other supported file formats’ images. Organizations with huge databases of pictures prefer to keep grayscale images for size considerations. For instance, some law enforcement agencies would consider facial features and geometry as important or efficient as compared to color. Let us take a look at available APIs for true color image to grayscale conversion with Aspose.Imaging Cloud API.
API | Description |
---|---|
GET /imaging/{name}/grayscale | Grayscale an existing image |
POST /imaging/grayscale | Grayscales an image. Image data is passed as zero-indexed multipart/form-data content or as raw body stream |
Following is a C# code snippet to convert a sample image to grayscale:
This code snippet uploads the input file from local storage to Cloud storage and then converts the RGB image to grayscale image. The API saves output grayscale image in Cloud storage that looks like below screenshot:
Input Image
Output Image
Let us check out another scenario where the source file is passed in request and the response contains converted grayscale image which is saved in local storage. This approach does not need uploading or downloading the image from Cloud storage. Below is the C# code snippet based on this workflow:
Wondering about working with the same feature in other programming languages? No worries, Aspose.Imaging Cloud SDKs are available for all popular languages so you can conveniently call the API from your favorite platforms. Moreover, we have also ported images to grayscale conversion examples to the supported languages including Python, Java, PHP, Node.js, and Ruby.
Aspose.Imaging Cloud API can take your applications a step forward to the next level. Many other fixes and maintenances are also part of this release; including some exception fixes and improvements for multi-page images export. You may take an overview at Release Notes for more details. You can Sign Up for free and start learning the API today. We maintain API documentation for basic scenarios. You can also reach out to us at Free Support Forum if you need any further help.
Related Post:
Reverse Image Search and Image Deskewing with Aspose.Imaging Cloud