- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2021 09:28 AM
Can you please recommend suggestions for image manipulation once you read the data as an image ? Any specific library to use?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2021 11:13 AM
Spark has a built-in 'image' data source which will read a directory of images files as a DataFrame: spark.read.format("image").load(...). The resulting DataFrame has the pixel data, dimensions, channels, etc.
You can also read image files 'manually' by using the 'binaryFiles' data source, which will give you the raw bytes of image files. You would then read them with (for example) PIL in Python.
For Python, PIL is pretty much the standard for image manipulation. For the JVM, I think I'd still use the old java.awt classes like BufferedImage.