Python street view processing tools
Project description
pysvi Street View Image Processing Library
This library provides a Photo class to handle basic street view image processing tasks, including reading images, displaying them, and retrieving image file details.
Features
- Read and display images
- Get image dimensions (width and height)
- Get image file size
Installation
-
Ensure you have Python installed.
-
Install the Pillow library if you haven't already:
pip install pillow
-
Download or clone this repository.
-
Include the street_view directory in your project.
Usage
Here is a basic example of how to use the Photo class:
from pysvi import Photo
# Create a Photo instance and read an image
photo = Photo('path_to_your_image.jpg')
# Display the object's string representation
print(photo)
# Show the image
photo.show_image()
# Get and print the image dimensions
print(f"Image size (width, height): {photo.get_image_size()}")
# Get and print the file size
print(f"File size (bytes): {photo.get_file_size()}")
API Documentation
API Documentation
Photo
__init__(self, file_path=None)
Initialize a Photo instance.
file_path(str, optional): The path to the image file. If provided, the image will be read during initialization.
read_image(self, file_path)
Read an image from a file path.
file_path(str): The path to the image file.
Raises:
FileNotFoundError: If the file does not exist.
show_image(self)
Display the image using the default image viewer.
get_image_size(self)
Get the size (width, height) of the image.
Returns:
- Tuple (int, int): The width and height of the image.
Raises:
ValueError: If no image is loaded.
get_file_size(self)
Get the file size of the image in bytes.
Returns:
- int: The file size in bytes.
Raises:
ValueError: If no file path is provided.
__repr__(self)
Return a string representation of the Photo instance.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file StreetSolarTrack-0.0.2.tar.gz.
File metadata
- Download URL: StreetSolarTrack-0.0.2.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d0dd9db15bed82faadfa9eb2edae8b7c46a61875f095bd3c437502d3a558e3e0
|
|
| MD5 |
456a2061511a53fd0ab7131a61916db2
|
|
| BLAKE2b-256 |
9af3c494a1de524201a1eb00fcd34c986372e63fefc7787832ea56e5dc96911b
|
File details
Details for the file StreetSolarTrack-0.0.2-py3-none-any.whl.
File metadata
- Download URL: StreetSolarTrack-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.11.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
52f70ce1239d4d1508503a79cb7d9f2c9a9a30192fd4b8c33b0a8ec90df84150
|
|
| MD5 |
89e0df628b3c9c43006723343204c58e
|
|
| BLAKE2b-256 |
ac729acd120092083fb1a7d6c18a2ca4b79a602a2ba84015e683b61333a4c1fe
|