No project description provided
Project description
ImageCli
Overview
ImageCli is a simple command-line interface designed to effectively handle image operations, allowing users to perform basic tasks through simple descriptive commands (without the need to understand complex tool design, speak freely)
Download
pip install open-image-cli
Examples
1. Image size
img size -f '/Users/youngfreefjs/Downloads/logo.png'
>> Image Pixels Size: 1024x1024
2. Image file size
img file-size -f '/Users/youngfreefjs/Downloads/logo.png'
>> Image File Size: 496470.00 bytes
Specify Return Unit
You can also specify the output unit for the file size (e.g. bytes, KB, MB):
img file-size -f '/Users/youngfreefjs/Downloads/logo.png' -u MB
>> Image File Size: 0.47 MB
3. Compress image file size
img compress -f '/Users/youngfreefjs/Downloads/logo.png' -t 0.1 -u MB
>> Compressed image saved to: /Users/youngfreefjs/Downloads/compressed_logo.png
>> Compressed Image Size: 0.09 MB
4. Change Photo background color
img background -f '/Users/youngfreefjs/Desktop/code/github/imagecli/static/passport_photo_blue.png' -c 'RED'
>> Image resolution: 1536x1024, Channels: 3
>> Modified image background `red` saved to: /Users/youngfreefjs/Desktop/code/github/imagecli/static/background_RED_passport_photo_blue.png
| Original Background Photo | RED Background Photo | WHITE Background Photo |
|---|---|---|
5. Merge images to a long image
Code by: my former company
@Meituan-Dianping
Please ensure that after taking the first screenshot, scroll 1/3 before taking the second screenshot. You can manually take screenshots (slide up from 2/3 of the screen height to 1/3) Alternatively, screenshots can be taken through UI automation, with a screen height ranging from 2/3 to 1/3
img merge -i '/Users/youngfreefjs/Desktop/code/github/imagecli/static/image_merge/taobaoPage1.JPG' -i '/Users/youngfreefjs/Desktop/code/github/imagecli/static/image_merge/taobaoPage2.JPG' -i '/Users/youngfreefjs/Desktop/code/github/imagecli/static/image_merge/taobaoPage3.JPG' -o '/Users/youngfreefjs/Desktop/code/github/imagecli/static/image_merge/merged.png'
>> Merged image saved to: /Users/youngfreefjs/Desktop/code/github/imagecli/static/image_merge/merged.png
| Original Images | Page1 Images | Page2 Images | Page3 Image |
|---|---|---|---|
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file open-image-cli-0.3.0.tar.gz.
File metadata
- Download URL: open-image-cli-0.3.0.tar.gz
- Upload date:
- Size: 9.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.21
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f30976244086fe7dec4ec5453f9d03b61531f47b2b4c511adbdbc0e402ed1d03
|
|
| MD5 |
37a1855f2d4d346aa8f22c8da25840c8
|
|
| BLAKE2b-256 |
3eb5034d9e0d81d522ddd6b6273cb009209ff083f224149ed6a61ea6fd8f3b94
|