Guides
Image Handling
Working with images in DataBridge
Image Handling
DataBridge offers robust support for working with images. This guide demonstrates how to ingest, retrieve, and work with image documents in DataBridge.
Ingesting Images
You can ingest images just like any other file, using the ingest_file
method:
Ingesting Images from Memory
You can also ingest images directly from memory:
Retrieving Images
When you retrieve chunks that contain images, the content
field of each FinalChunkResult
object will be a PILImage
object for image chunks:
Multimodal Queries
DataBridge supports multimodal queries, where you can search for images based on text descriptions:
Image Processing Examples
Example 1: Display Images in a Grid
Example 2: Filter Images by Size
Example 3: Converting Images
Best Practices for Images
- Metadata: Always include descriptive metadata with images to improve search accuracy.
-
Use ColPali: Set
use_colpali=True
when ingesting and retrieving images for best results. -
Image Size: Be aware of image sizes when retrieving many images to avoid memory issues.
- Batch Processing: When working with many images, process them in batches.