Library for working with images based on Pillow
Project description
Work With Image
English
This Python library based on Pillow
, workwithimage
, allows you to work with images. Features available in this version:
- Converting an image into ASKII art
- Image resolution adjustment
- Changing the image format
Installation
pip install pillow
pip install workwithimage
Converting an image to ASKII art
from workwithimage import convert_to_ascii
# Example usage
image_path = "your_image.jpg"
columns = 150
ascii_image = convert_to_ascii(image_path, columns)
print(ascii_image)
# Save to file
with open("output.txt", "w") as file:
file.write(ascii_image)
Image resolution adjustment
from workwithimage import resize_image
# Example usage
image_path = "your_image.jpg"
new_width = 800
new_height = 600
resized_image = resize_image(image_path, new_width, new_height)
Changing the image format
from workwithimage import convert_image_format
# Example usage
input_image_path = "your_image.jpg"
desired_output_format = "png"
output_image_path = convert_image_format(input_image_path, desired_output_format)
Supported Image Formats
- JPEG
- PNG
- GIF
- BMP
- TIFF
- WebP
- ICO
- and more
Important Note
- The library supports various image formats; check Pillow documentation for the complete list.
Russian
Библиотека на Python на основе Pillow
, workwithimage
, позволяет работать с изображениями. Функции доступные в данной версии:
- Перобразование изображения в ASKII-арт
- Изменение разрешения изображения
- Изменение разрешения изображения
Установка
pip install pillow
pip install workwithimage
Перобразование изображения в ASKII-арт
from workwithimage import convert_to_ascii
# Пример использования
image_path = "ваше_изображение.jpg"
columns = 150
ascii_image = convert_to_ascii(image_path, columns)
print(ascii_image)
# Сохранение в файл
with open("output.txt", "w") as file:
file.write(ascii_image)
Изменение разрешения изображения
from workwithimage import resize_image
# Пример использования
image_path = "ваше_изображение.jpg"
new_width = 800
new_height = 600
resized_image = resize_image(image_path, new_width, new_height)
Изменение формата изображения
from workwithimage import convert_image_format
# Пример использования
input_image_path = "ваше_изображение.jpg"
desired_output_format = "png"
output_image_path = convert_image_format(input_image_path, desired_output_format)
Поддерживаемые форматы изображений
- JPEG
- PNG
- GIF
- BMP
- TIFF
- WebP
- ICO
- и другие
Важное замечания
- Библиотека поддерживает различные форматы изображений; проверьте документацию Pillow для полного списка.
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
workwithimage-0.0.4.1.tar.gz
(2.3 kB
view hashes)
Built Distribution
Close
Hashes for workwithimage-0.0.4.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03aedf56d9509139316538ab5dd3052d8c31ea2cc1638bc14a73a8ac070bf0ea |
|
MD5 | 7ab7333daa9fb7ffb2f92b29f21ec4d6 |
|
BLAKE2b-256 | f696a8c5b54a0ce7c0f7189d3295f1b5831112a37c53dbe6584d0ece686f4871 |