jekillow 11.0.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- jekillow-11.0.0/PIL/__init__.py +72 -0
- jekillow-11.0.0/PKG-INFO +76 -0
- jekillow-11.0.0/README.md +62 -0
- jekillow-11.0.0/jekillow/ExifTags.py +62 -0
- jekillow-11.0.0/jekillow/Image.py +731 -0
- jekillow-11.0.0/jekillow/ImageChops.py +43 -0
- jekillow-11.0.0/jekillow/ImageCms.py +131 -0
- jekillow-11.0.0/jekillow/ImageColor.py +111 -0
- jekillow-11.0.0/jekillow/ImageDraw.py +114 -0
- jekillow-11.0.0/jekillow/ImageEnhance.py +36 -0
- jekillow-11.0.0/jekillow/ImageFilter.py +173 -0
- jekillow-11.0.0/jekillow/ImageFont.py +91 -0
- jekillow-11.0.0/jekillow/ImageGrab.py +19 -0
- jekillow-11.0.0/jekillow/ImageMath.py +24 -0
- jekillow-11.0.0/jekillow/ImageMorph.py +56 -0
- jekillow-11.0.0/jekillow/ImageOps.py +55 -0
- jekillow-11.0.0/jekillow/ImagePalette.py +74 -0
- jekillow-11.0.0/jekillow/ImagePath.py +46 -0
- jekillow-11.0.0/jekillow/ImageQt.py +39 -0
- jekillow-11.0.0/jekillow/ImageSequence.py +35 -0
- jekillow-11.0.0/jekillow/ImageShow.py +78 -0
- jekillow-11.0.0/jekillow/ImageStat.py +54 -0
- jekillow-11.0.0/jekillow/ImageTk.py +45 -0
- jekillow-11.0.0/jekillow/ImageTransform.py +44 -0
- jekillow-11.0.0/jekillow/ImageWin.py +50 -0
- jekillow-11.0.0/jekillow/TiffTags.py +53 -0
- jekillow-11.0.0/jekillow/__init__.py +78 -0
- jekillow-11.0.0/jekillow/_core.py +113 -0
- jekillow-11.0.0/jekillow/_data/the_photo.jpg +0 -0
- jekillow-11.0.0/jekillow/features.py +80 -0
- jekillow-11.0.0/jekillow.egg-info/PKG-INFO +76 -0
- jekillow-11.0.0/jekillow.egg-info/SOURCES.txt +34 -0
- jekillow-11.0.0/jekillow.egg-info/dependency_links.txt +1 -0
- jekillow-11.0.0/jekillow.egg-info/top_level.txt +2 -0
- jekillow-11.0.0/pyproject.toml +28 -0
- jekillow-11.0.0/setup.cfg +4 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"""PIL — alias of :mod:`jekillow` for drop-in Pillow compatibility.
|
|
2
|
+
|
|
3
|
+
If you already have real Pillow installed, *that* will win; uninstall it (or
|
|
4
|
+
arrange your import path so this package comes first) for the joke to land.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from __future__ import annotations
|
|
8
|
+
|
|
9
|
+
import sys as _sys
|
|
10
|
+
|
|
11
|
+
import jekillow as _jekillow
|
|
12
|
+
|
|
13
|
+
# Mirror metadata.
|
|
14
|
+
__version__ = _jekillow.__version__
|
|
15
|
+
PILLOW_VERSION = _jekillow.PILLOW_VERSION
|
|
16
|
+
VERSION = _jekillow.VERSION
|
|
17
|
+
_plugins = _jekillow._plugins # type: ignore[attr-defined]
|
|
18
|
+
|
|
19
|
+
# Re-export every submodule under the PIL.* namespace.
|
|
20
|
+
from jekillow import ( # noqa: F401 (re-exports)
|
|
21
|
+
Image,
|
|
22
|
+
ImageChops,
|
|
23
|
+
ImageCms,
|
|
24
|
+
ImageColor,
|
|
25
|
+
ImageDraw,
|
|
26
|
+
ImageEnhance,
|
|
27
|
+
ImageFilter,
|
|
28
|
+
ImageFont,
|
|
29
|
+
ImageGrab,
|
|
30
|
+
ImageMath,
|
|
31
|
+
ImageMorph,
|
|
32
|
+
ImageOps,
|
|
33
|
+
ImagePalette,
|
|
34
|
+
ImagePath,
|
|
35
|
+
ImageQt,
|
|
36
|
+
ImageSequence,
|
|
37
|
+
ImageShow,
|
|
38
|
+
ImageStat,
|
|
39
|
+
ImageTk,
|
|
40
|
+
ImageTransform,
|
|
41
|
+
ImageWin,
|
|
42
|
+
ExifTags,
|
|
43
|
+
TiffTags,
|
|
44
|
+
features,
|
|
45
|
+
)
|
|
46
|
+
|
|
47
|
+
|
|
48
|
+
# Register the submodules under PIL.* so e.g. ``import PIL.ImageDraw`` works
|
|
49
|
+
# even when nothing has imported jekillow yet.
|
|
50
|
+
for _name in (
|
|
51
|
+
"Image", "ImageChops", "ImageCms", "ImageColor", "ImageDraw",
|
|
52
|
+
"ImageEnhance", "ImageFilter", "ImageFont", "ImageGrab", "ImageMath",
|
|
53
|
+
"ImageMorph", "ImageOps", "ImagePalette", "ImagePath", "ImageQt",
|
|
54
|
+
"ImageSequence", "ImageShow", "ImageStat", "ImageTk", "ImageTransform",
|
|
55
|
+
"ImageWin", "ExifTags", "TiffTags", "features",
|
|
56
|
+
):
|
|
57
|
+
_sys.modules[f"PIL.{_name}"] = _sys.modules[f"jekillow.{_name}"]
|
|
58
|
+
del _name
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
class UnidentifiedImageError(OSError):
|
|
62
|
+
"""Mirror of :class:`PIL.UnidentifiedImageError`. Never actually raised."""
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
__all__ = [
|
|
66
|
+
"Image", "ImageChops", "ImageCms", "ImageColor", "ImageDraw",
|
|
67
|
+
"ImageEnhance", "ImageFilter", "ImageFont", "ImageGrab", "ImageMath",
|
|
68
|
+
"ImageMorph", "ImageOps", "ImagePalette", "ImagePath", "ImageQt",
|
|
69
|
+
"ImageSequence", "ImageShow", "ImageStat", "ImageTk", "ImageTransform",
|
|
70
|
+
"ImageWin", "ExifTags", "TiffTags", "features",
|
|
71
|
+
"UnidentifiedImageError", "__version__", "PILLOW_VERSION", "VERSION",
|
|
72
|
+
]
|
jekillow-11.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: jekillow
|
|
3
|
+
Version: 11.0.0
|
|
4
|
+
Summary: Jekillow — joke clone of Pillow where every image becomes the Жэ.
|
|
5
|
+
Author: Jekillow
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://example.invalid/jekillow
|
|
8
|
+
Keywords: jekillow,pillow,image,joke
|
|
9
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
10
|
+
Classifier: Programming Language :: Python :: 3
|
|
11
|
+
Classifier: Topic :: Multimedia :: Graphics
|
|
12
|
+
Requires-Python: >=3.7
|
|
13
|
+
Description-Content-Type: text/markdown
|
|
14
|
+
|
|
15
|
+
# Jekillow
|
|
16
|
+
|
|
17
|
+
> Pillow, but with one `l` — and every image you touch becomes the same selfie.
|
|
18
|
+
|
|
19
|
+
`jekillow` is a joke clone of [Pillow](https://pillow.readthedocs.io/). It exposes
|
|
20
|
+
the same module structure (`Image`, `ImageDraw`, `ImageFilter`, `ImageOps`,
|
|
21
|
+
`ImageEnhance`, `ImageChops`, `ImageColor`, `ImageFont`, `ImageStat`,
|
|
22
|
+
`ImageQt`, `ImageTk`, `ImageWin`, `ImageCms`, `ImageGrab`, `ImageMath`,
|
|
23
|
+
`ImageMorph`, `ImagePalette`, `ImagePath`, `ImageShow`, `ImageSequence`,
|
|
24
|
+
`ImageTransform`, `ExifTags`, `TiffTags`, `features`) and the same set of
|
|
25
|
+
functions and methods. They all do exactly one thing: turn the image they touch
|
|
26
|
+
into **the** photo bundled with the package.
|
|
27
|
+
|
|
28
|
+
```python
|
|
29
|
+
import jekillow # this also hijacks the name `PIL`
|
|
30
|
+
from PIL import Image, ImageFilter, ImageOps # joke version
|
|
31
|
+
|
|
32
|
+
img = Image.open("kitten.png") # not a kitten anymore
|
|
33
|
+
img = img.rotate(90) # still the photo
|
|
34
|
+
img = img.filter(ImageFilter.GaussianBlur(8)) # still the photo
|
|
35
|
+
img = ImageOps.grayscale(img) # still the photo
|
|
36
|
+
img.save("output.jpg") # writes the photo
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Install
|
|
40
|
+
|
|
41
|
+
```
|
|
42
|
+
pip install -e .
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Importing as `PIL`
|
|
46
|
+
|
|
47
|
+
If real Pillow is also installed in your environment (other libraries often
|
|
48
|
+
require it), import `jekillow` first — that forcibly registers itself under the
|
|
49
|
+
`PIL` name in `sys.modules`. After that, `from PIL import Image` gives the joke
|
|
50
|
+
version for the rest of the process.
|
|
51
|
+
|
|
52
|
+
```python
|
|
53
|
+
import jekillow
|
|
54
|
+
from PIL import Image, ImageDraw # joke version, even with real Pillow installed
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
If real Pillow is *not* installed, `import PIL` works directly because we ship
|
|
58
|
+
a `PIL` package alongside `jekillow`.
|
|
59
|
+
|
|
60
|
+
## What it actually does
|
|
61
|
+
|
|
62
|
+
* Module-level constructors (`Image.open`, `Image.new`, `Image.frombytes`, ...)
|
|
63
|
+
always return an `Image` whose pixels are the bundled photo.
|
|
64
|
+
* Every `Image` method (`rotate`, `resize`, `filter`, `convert`, `crop`,
|
|
65
|
+
`paste`, ...) returns a fresh `Image` of the same photo. Mutating methods
|
|
66
|
+
like `paste` are no-ops.
|
|
67
|
+
* `Image.save(path)` writes the bundled photo's bytes to `path` regardless of
|
|
68
|
+
the format you ask for.
|
|
69
|
+
* `Image.show()` opens the photo in the system viewer.
|
|
70
|
+
* Pixel access (`getpixel`, `load()[x, y]`, etc.) returns plausible values.
|
|
71
|
+
* `ImageDraw.Draw(img).rectangle(...)`, `.text(...)`, `.line(...)` — all
|
|
72
|
+
no-ops. Drawing on the photo doesn't change it.
|
|
73
|
+
* `ImageColor.getrgb("red")`, EXIF tag tables, etc. work for real because
|
|
74
|
+
they don't depend on pixel data.
|
|
75
|
+
|
|
76
|
+
It is a joke. Don't ship it to production.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Jekillow
|
|
2
|
+
|
|
3
|
+
> Pillow, but with one `l` — and every image you touch becomes the same selfie.
|
|
4
|
+
|
|
5
|
+
`jekillow` is a joke clone of [Pillow](https://pillow.readthedocs.io/). It exposes
|
|
6
|
+
the same module structure (`Image`, `ImageDraw`, `ImageFilter`, `ImageOps`,
|
|
7
|
+
`ImageEnhance`, `ImageChops`, `ImageColor`, `ImageFont`, `ImageStat`,
|
|
8
|
+
`ImageQt`, `ImageTk`, `ImageWin`, `ImageCms`, `ImageGrab`, `ImageMath`,
|
|
9
|
+
`ImageMorph`, `ImagePalette`, `ImagePath`, `ImageShow`, `ImageSequence`,
|
|
10
|
+
`ImageTransform`, `ExifTags`, `TiffTags`, `features`) and the same set of
|
|
11
|
+
functions and methods. They all do exactly one thing: turn the image they touch
|
|
12
|
+
into **the** photo bundled with the package.
|
|
13
|
+
|
|
14
|
+
```python
|
|
15
|
+
import jekillow # this also hijacks the name `PIL`
|
|
16
|
+
from PIL import Image, ImageFilter, ImageOps # joke version
|
|
17
|
+
|
|
18
|
+
img = Image.open("kitten.png") # not a kitten anymore
|
|
19
|
+
img = img.rotate(90) # still the photo
|
|
20
|
+
img = img.filter(ImageFilter.GaussianBlur(8)) # still the photo
|
|
21
|
+
img = ImageOps.grayscale(img) # still the photo
|
|
22
|
+
img.save("output.jpg") # writes the photo
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Install
|
|
26
|
+
|
|
27
|
+
```
|
|
28
|
+
pip install -e .
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Importing as `PIL`
|
|
32
|
+
|
|
33
|
+
If real Pillow is also installed in your environment (other libraries often
|
|
34
|
+
require it), import `jekillow` first — that forcibly registers itself under the
|
|
35
|
+
`PIL` name in `sys.modules`. After that, `from PIL import Image` gives the joke
|
|
36
|
+
version for the rest of the process.
|
|
37
|
+
|
|
38
|
+
```python
|
|
39
|
+
import jekillow
|
|
40
|
+
from PIL import Image, ImageDraw # joke version, even with real Pillow installed
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
If real Pillow is *not* installed, `import PIL` works directly because we ship
|
|
44
|
+
a `PIL` package alongside `jekillow`.
|
|
45
|
+
|
|
46
|
+
## What it actually does
|
|
47
|
+
|
|
48
|
+
* Module-level constructors (`Image.open`, `Image.new`, `Image.frombytes`, ...)
|
|
49
|
+
always return an `Image` whose pixels are the bundled photo.
|
|
50
|
+
* Every `Image` method (`rotate`, `resize`, `filter`, `convert`, `crop`,
|
|
51
|
+
`paste`, ...) returns a fresh `Image` of the same photo. Mutating methods
|
|
52
|
+
like `paste` are no-ops.
|
|
53
|
+
* `Image.save(path)` writes the bundled photo's bytes to `path` regardless of
|
|
54
|
+
the format you ask for.
|
|
55
|
+
* `Image.show()` opens the photo in the system viewer.
|
|
56
|
+
* Pixel access (`getpixel`, `load()[x, y]`, etc.) returns plausible values.
|
|
57
|
+
* `ImageDraw.Draw(img).rectangle(...)`, `.text(...)`, `.line(...)` — all
|
|
58
|
+
no-ops. Drawing on the photo doesn't change it.
|
|
59
|
+
* `ImageColor.getrgb("red")`, EXIF tag tables, etc. work for real because
|
|
60
|
+
they don't depend on pixel data.
|
|
61
|
+
|
|
62
|
+
It is a joke. Don't ship it to production.
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
"""jekillow.ExifTags — minimal subset of EXIF tag tables."""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
import enum
|
|
6
|
+
|
|
7
|
+
__all__ = ["TAGS", "GPSTAGS", "IFD", "Base", "GPS", "Interop"]
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
TAGS = {
|
|
11
|
+
0x0100: "ImageWidth", 0x0101: "ImageLength", 0x010E: "ImageDescription",
|
|
12
|
+
0x010F: "Make", 0x0110: "Model", 0x0112: "Orientation",
|
|
13
|
+
0x011A: "XResolution", 0x011B: "YResolution", 0x0128: "ResolutionUnit",
|
|
14
|
+
0x0131: "Software", 0x0132: "DateTime", 0x013B: "Artist",
|
|
15
|
+
0x013E: "WhitePoint", 0x013F: "PrimaryChromaticities",
|
|
16
|
+
0x8769: "ExifOffset", 0x8825: "GPSInfo",
|
|
17
|
+
0x9000: "ExifVersion", 0x9003: "DateTimeOriginal",
|
|
18
|
+
0x9004: "DateTimeDigitized", 0x9201: "ShutterSpeedValue",
|
|
19
|
+
0x9202: "ApertureValue", 0x9203: "BrightnessValue",
|
|
20
|
+
0x9204: "ExposureBiasValue", 0x9207: "MeteringMode",
|
|
21
|
+
0x9208: "LightSource", 0x9209: "Flash", 0x920A: "FocalLength",
|
|
22
|
+
0xA002: "ExifImageWidth", 0xA003: "ExifImageHeight",
|
|
23
|
+
0xA210: "FocalPlaneResolutionUnit",
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
GPSTAGS = {
|
|
28
|
+
0: "GPSVersionID", 1: "GPSLatitudeRef", 2: "GPSLatitude",
|
|
29
|
+
3: "GPSLongitudeRef", 4: "GPSLongitude", 5: "GPSAltitudeRef",
|
|
30
|
+
6: "GPSAltitude", 7: "GPSTimeStamp", 29: "GPSDateStamp",
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class IFD(enum.IntEnum):
|
|
35
|
+
Exif = 0x8769
|
|
36
|
+
GPSInfo = 0x8825
|
|
37
|
+
Makernote = 0x927C
|
|
38
|
+
Interop = 0xA005
|
|
39
|
+
IFD1 = -1
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
class Base(enum.IntEnum):
|
|
43
|
+
ImageWidth = 0x0100
|
|
44
|
+
ImageLength = 0x0101
|
|
45
|
+
Orientation = 0x0112
|
|
46
|
+
Make = 0x010F
|
|
47
|
+
Model = 0x0110
|
|
48
|
+
DateTime = 0x0132
|
|
49
|
+
Software = 0x0131
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class GPS(enum.IntEnum):
|
|
53
|
+
GPSVersionID = 0
|
|
54
|
+
GPSLatitudeRef = 1
|
|
55
|
+
GPSLatitude = 2
|
|
56
|
+
GPSLongitudeRef = 3
|
|
57
|
+
GPSLongitude = 4
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
class Interop(enum.IntEnum):
|
|
61
|
+
InteropIndex = 1
|
|
62
|
+
InteropVersion = 2
|