pycharmers.cli.tweetile module¶
-
pycharmers.cli.tweetile.
tweetile
(argv=['-M', 'html', '.', '_build'])[source]¶ Divide one image into three so that you can tweet beautifully.
- Parameters
path (str) – Path to the input image.
--quality (int) – The image quality, on a scale from
1
(worst) to95
(best). Defaults to95
.--loop (int) – How many times gif image loops. Defaults to
0
. (infinite loop.)
Note
When you run from the command line, execute as follows:
$ tweetile path/to/filename.jpg --quality 75 $ tweetile path/to/filename.gif --loop 0
Example
This movie is from @anime_shingeki
https://twitter.com/anime_shingeki/status/1376196378624282625
-
pycharmers.cli.tweetile.
divideInto3forTweet
()[source]¶ Divide Image into 3 for Tweet
Size
- Parameters
img_arr (NDArray[(636,1132,Any), np.uint8]) – Input image array (RGB)
- Returns
A tuple of each Image object divided into three.
- Return type
Tuple[Image.Image,Image.Image,Image.Image]
Examples
>>> import cv2 >>> from pycharmers.cli.tweetile import divideInto3forTweet >>> img_bgr = cv2.imread("cli.tweetile-before.jpg") >>> img_rgb = cv2.cvtColor(img_bgr, cv2.COLOR_BGR2RGB) >>> for i,img in enumerate(divideInto3forTweet(img_rgb), start=1): ... img.save(f"cli.tweetile-after{i}.jpg", quality=95)
Example
Before
After