create method
Leave feedback
On this page
Creates an image from a file for searching.
def create(cls, file_path):
...
| Parameter | Type | Description |
|---|---|---|
| file_path | str |
The image file path. |
Returns: SearchImage: An image to search.
from groupdocs.search.common import SearchImage
search_image = SearchImage.create("./image.png")
Creates an image from a file for searching.
def create(cls, file_path, image_index):
...
| Parameter | Type | Description |
|---|---|---|
| file_path | str |
The image file path. |
| image_index | int |
The image index in multipage images. |
Returns: SearchImage: An image to search.
Creates an image from a stream for searching.
def create(cls, stream):
...
| Parameter | Type | Description |
|---|---|---|
| stream | io.RawIOBase |
The image stream. |
Returns: SearchImage: An image to search.
from groupdocs.search.common import SearchImage
with open("image.png", "rb") as f:
search_image = SearchImage.create(f)
Creates an image from a stream to search.
def create(cls, stream, image_index):
...
| Parameter | Type | Description |
|---|---|---|
| stream | io.RawIOBase |
The image stream. |
| image_index | int |
The image index in multipage images. |
Returns: SearchImage: An image to search.
from groupdocs.search.common import SearchImage
# Open an image file as a binary stream
with open("./image.png", "rb") as stream:
# Create a SearchImage from the stream (first page = 0)
search_image = SearchImage.create(stream, image_index=0)
# Use `search_image` with a Searcher instance
# searcher.search_first(search_image, ...)
These names call create too, limited to the overloads listed.
| Alias | Accepts |
|---|---|
create_file |
create_file(file_path, image_index)create_file(file_path) |
create_string |
create_string(file_path, image_index)create_string(file_path) |
create_stream |
create_stream(stream, image_index)create_stream(stream) |
create_streams |
create_streams(stream, image_index)create_streams(stream) |
- class
SearchImage
Was this page helpful?
Any additional feedback you'd like to share with us?
Please tell us how we can improve this page.
Thank you for your feedback!
We value your opinion. Your feedback will help us improve our documentation.