A module for basic image processing.
Project description
ImageKit
A simple python package for basic Image Processing.
1. Installing Package
pip install Image-Kit
Requirement already satisfied: Image-Kit in /srv/conda/lib/python3.6/site-packages (0.1.0)
Requirement already satisfied: Pillow in /srv/conda/lib/python3.6/site-packages (from Image-Kit) (6.0.0)
Requirement already satisfied: matplotlib in /srv/conda/lib/python3.6/site-packages (from Image-Kit) (3.0.3)
Requirement already satisfied: numpy in /srv/conda/lib/python3.6/site-packages (from Image-Kit) (1.16.3)
Requirement already satisfied: scipy in /srv/conda/lib/python3.6/site-packages (from Image-Kit) (1.2.1)
Requirement already satisfied: cycler>=0.10 in /srv/conda/lib/python3.6/site-packages (from matplotlib->Image-Kit) (0.10.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /srv/conda/lib/python3.6/site-packages (from matplotlib->Image-Kit) (1.0.1)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /srv/conda/lib/python3.6/site-packages (from matplotlib->Image-Kit) (2.4.0)
Requirement already satisfied: python-dateutil>=2.1 in /srv/conda/lib/python3.6/site-packages (from matplotlib->Image-Kit) (2.8.0)
Requirement already satisfied: six in /srv/conda/lib/python3.6/site-packages (from cycler>=0.10->matplotlib->Image-Kit) (1.12.0)
Requirement already satisfied: setuptools in /srv/conda/lib/python3.6/site-packages (from kiwisolver>=1.0.1->matplotlib->Image-Kit) (40.8.0)
or
pip install git+https://github.com/syamkakarla98/Image-Kit.git
Collecting git+https://github.com/syamkakarla98/Image-Kit.git
Cloning https://github.com/syamkakarla98/Image-Kit.git to /tmp/pip-req-build-6aa9lngi
Requirement already satisfied (use --upgrade to upgrade): Image-Kit==1.0.0 from git+https://github.com/syamkakarla98/Image-Kit.git in /srv/conda/lib/python3.6/site-packages
Requirement already satisfied: numpy in /srv/conda/lib/python3.6/site-packages (from Image-Kit==1.0.0) (1.16.3)
Requirement already satisfied: matplotlib in /srv/conda/lib/python3.6/site-packages (from Image-Kit==1.0.0) (3.0.3)
Requirement already satisfied: Pillow in /srv/conda/lib/python3.6/site-packages (from Image-Kit==1.0.0) (6.0.0)
Requirement already satisfied: scipy in /srv/conda/lib/python3.6/site-packages (from Image-Kit==1.0.0) (1.2.1)
Requirement already satisfied: cycler>=0.10 in /srv/conda/lib/python3.6/site-packages (from matplotlib->Image-Kit==1.0.0) (0.10.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /srv/conda/lib/python3.6/site-packages (from matplotlib->Image-Kit==1.0.0) (1.0.1)
Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /srv/conda/lib/python3.6/site-packages (from matplotlib->Image-Kit==1.0.0) (2.4.0)
Requirement already satisfied: python-dateutil>=2.1 in /srv/conda/lib/python3.6/site-packages (from matplotlib->Image-Kit==1.0.0) (2.8.0)
Requirement already satisfied: six in /srv/conda/lib/python3.6/site-packages (from cycler>=0.10->matplotlib->Image-Kit==1.0.0) (1.12.0)
Requirement already satisfied: setuptools in /srv/conda/lib/python3.6/site-packages (from kiwisolver>=1.0.1->matplotlib->Image-Kit==1.0.0) (40.8.0)
Building wheels for collected packages: Image-Kit
Building wheel for Image-Kit (setup.py) ... [?25ldone
[?25h Stored in directory: /tmp/pip-ephem-wheel-cache-jfihyo34/wheels/86/91/2c/89b389a7ca0e7839e1b079068e5f48751c0f1acba07f84bb59
Successfully built Image-Kit
Note: you may need to restart the kernel to use updated packages.
2. Importing Package
from ImageKit import ImgKit as i
3. Imformation about package
help(i)
Help on module ImageKit.ImgKit in ImageKit:
NAME
ImageKit.ImgKit
FUNCTIONS
get_band(img, band)
get_pixels(img)
get_properties(img)
im2bw(img)
imread(filename)
Summary: Reads a iamge file and return an object.
Args: filename.
Returns: An object of an image.
imrotate(img, degrees)
imsave(img, filename)
imshow(img)
Summary: displays a iamge file and return an object.
Args: filename.
plot_signature(img)
resize(img, s)
FILE
/srv/conda/lib/python3.6/site-packages/ImageKit/ImgKit.py
4. Downloading a sample image
import urllib
urllib.request.urlretrieve("https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcS3kf6ZTospvdkbQ0G6xVraiA0tOTx8zrUDrP0aIsJ0cYLRb5nKag","fun.jpg")
('fun.jpg', <http.client.HTTPMessage at 0x7f82ccd712b0>)
5. Read the image
x = i.imread('fun.jpg')
6.. Display the image
i.imshow(x)
7. Description of the image
desc = i.get_properties(x)
for name, value in zip(desc.keys(), desc.values()):
print("%10s => %1s"%(str(name), str(value)))
filename => fun.jpg
format => JPEG
mode => RGB
dimensions => (158, 319, 3)
8. Resize the image
x1 = i.resize(x, (700, 500))
i.imshow(x1)
9. Save the image
i.imsave(x1, 'new_fun.jpg')
10. Rotating the image
i.imshow(i.imrotate(x, 92))
11. Converting image to grayscale
i.imshow(i.im2bw(x))
12. Extract pixels from the image
i.get_pixels(i.resize(x, (5, 5)))
[(64, 65, 70),
(64, 65, 70),
(64, 65, 70),
(64, 65, 70),
(64, 65, 70),
(64, 65, 70),
(64, 65, 70),
(35, 140, 170),
(65, 66, 71),
(64, 65, 70),
(64, 65, 70),
(65, 66, 71),
(255, 215, 81),
(64, 65, 70),
(64, 65, 70),
(64, 65, 70),
(65, 66, 71),
(97, 90, 167),
(64, 65, 70),
(64, 65, 70),
(64, 65, 70),
(64, 65, 70),
(64, 65, 70),
(54, 72, 58),
(64, 65, 70)]
13. Extracting bands from the image
i.imshow(i.get_band(x, 'r'))
i.imshow(i.get_band(x, 'g'))
i.imshow(i.get_band(x, 'b'))
14. Pixel signature of the image
i.plot_signature(x)
Thank You
Do star the repository, if you like it.
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
Image-Kit-0.0.3.tar.gz
(4.4 kB
view details)
Built Distribution
File details
Details for the file Image-Kit-0.0.3.tar.gz
.
File metadata
- Download URL: Image-Kit-0.0.3.tar.gz
- Upload date:
- Size: 4.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8644707ef72d9b7997795ea6e90941451c431a24b92e297afb09157cf2142828 |
|
MD5 | 87605cb4cb75c90d04890f147f43e1c0 |
|
BLAKE2b-256 | 8ed5e22e844cefadb447ba9c102d3e6a6ee44613e347bf74f72b5ce045dbf7bb |
File details
Details for the file Image_Kit-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: Image_Kit-0.0.3-py3-none-any.whl
- Upload date:
- Size: 5.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.28.1 CPython/3.6.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e3cd8f6913b0c10defe5e43834f511846867d6f38cc92d246dec23b44056e17 |
|
MD5 | 205a4797e692c87c717682f1fc4780d4 |
|
BLAKE2b-256 | 2a762b9f317021a999ea88e71fc1c7e3a873f8173b56b04132ec7bb21e90de71 |