mikemathia, to random
@mikemathia@ioc.exchange avatar
villares, to python
@villares@ciberlandia.pt avatar

I wrote this to demo a quick #Python #Pillow #PIL conversion of an image to grayscale with a dialog to select the file... then applied it to a picture of me and @rennerocha
taken by John as we were flying back home after wonderful #PyConUS24 :)

from tkinter.filedialog import askopenfilename<br></br>from pathlib import Path<br></br><br></br>from PIL import Image<br></br><br></br># Open a select file dialog (a bit ugly on my OS)<br></br>file_path_str = askopenfilename() # '' if cancelled<br></br>if file_path_str:  # guards against a cancelled dialog<br></br>    file_path = Path(file_path_str) # a pathlib.Path object from the str<br></br>    new_name = file_path.stem + '_altered' + file_path.suffix # keep suffix<br></br>    # Make it output a PNG if you want LA mode to keep alpha<br></br>    # new_name = file_path.stem + '_altered.png' maybe I should check for PNGs?<br></br>    output_path = file_path.parent / new_name<br></br>    try:  # to handle any exceptions (runtime errors while converting/saving)<br></br>        with Image.open(file_path) as im:  # load image<br></br>            altered_im = im.convert('L')   # to grayscale (use 'LA' to keep alpha)<br></br>            altered_im.save(output_path)   # save image<br></br>            print(f'Saved {output_path.name}!')<br></br>    except Exception as err:  # ... treat exception<br></br>        print(err)<br></br>
ariana_makes, to crochet
@ariana_makes@pixelfed.social avatar

Back to the succulent pillow project - time to sew all the pieces together! I'm figuring it out as I go along, as this is my first time sewing crochet, and the pattern I'm using doesn't really have any guidance.

#crochet #diy #craft #crafting #handmade #textile #yarn #fiberarts #maker #makermovement #decorating #pillow #succulent

driscollis, to python
@driscollis@mastodon.social avatar

The latest edition of The Python Papers Newsletter is out 🐍🚀

Learn even more about drawing shapes on images with and in this final installment of a three-part series!

driscollis, to python
@driscollis@mastodon.social avatar

Did you know you can watermark images with and ?

Here's the code and its output 🐍🔥

image/png

hugovk, to python
@hugovk@mastodon.social avatar

🐦☠️➡️ 🐘🚀

We archived Pillow's tweets at https://python-pillow.org/twitter-archive/ using @tinysubversions's archiving tool https://tinysubversions.com/twitter-archive/make-your-own/ and removed all mention of the Twitter account from the docs, then deleted the account.

Please follow @pillow from now on!

atarifrosch, to random German
@atarifrosch@mastodon.de avatar

Liebe Menschen, die Dinge mit Python3 und Fotos machen: Gibt es einen Trick, die Größe eines Fotos zu ermitteln, das keine EXIF-Daten (oder andere Meta-Daten) hat?

Hintergrund: Ich möchte Fotos, die ich vorher gescannt habe, für einen bestimmten Zweck runterskalieren. Dazu verwende ich meinen downscaler (https://git.atari-frosch.de/?p=downscaler.git;a=tree). Der verläßt sich allerdings auf PIL, ergo auf vorhandene EXIF-Daten. Bei Scans hab ich die natürlich nicht.

downscaler meint, die Dateien seien schon zu klein, aber da muß ich nochmal nachschauen, warum das Fehlen der EXIF-Daten so interpretiert wird.

pillow, to python
@pillow@fosstodon.org avatar

Pillow 10.3.0 has been released!

Includes security fixes, some deprecations, API additions and changes, performance improvements and type hints.

This was our first release with cibuildwheel + PyPI publish GitHub Action + Trusted Publishers and it went smoothly!

Thanks to the teams who created those, and as always, to all our contributors.

#PythonPillow #Python #Pillow #OpenSource #release

Deprecations ImageCms constants and versions() function A number of constants and a function in ImageCms have been deprecated. This includes a table of flags based on LittleCMS version 1 which has been replaced with a new class ImageCms.Flags based on LittleCMS 2 flags. Check the full release notes for the table of replacements. ImageMath.eval() ImageMath.eval() has been deprecated. Use lambda_eval() or unsafe_eval() instead. See earlier security notes for more information.
API Changes Added alpha_quality argument when saving WebP images When saving WebP images, an alpha_quality argument can be passed to the encoder. It is an integer value between 0 to 100, where values other than 100 will provide lossy compression. Negative kmeans error When calling quantize(), a negative kmeans will now raise a ValueError, unless a palette is supplied to make the value redundant. Negative P1-P3 PPM value error If a P1-P3 PPM image contains a negative value, a ValueError will now be raised. API Additions Added PerspectiveTransform PerspectiveTransform has been added, meaning that all of the Transform values now have a corresponding subclass of Transform. Other Changes Portable FloatMap (PFM) images Support has been added for reading and writing grayscale (Pf format) Portable FloatMap (PFM) files containing F data. Release GIL when fetching WebP frames Python’s Global Interpreter Lock is now released when fetching WebP frames from the libwebp decoder. Type hints Pillow now has type hints for a large part of its modules, and the package includes a py.typed file and the Typing :: Typed Trove classifier.

hugovk, to python
@hugovk@mastodon.social avatar

🥚🐰🛞🐍 Exciting!

I'm doing the first @pillow release using cibuildwheel + PyPI publish GitHub Action + Trusted Publishers!

It'll take just under three hours to build 68 wheels and an sdist, and then upload them automatically to @pypi 🤞

The matrix covers CPython 3.8-3.12, PyPy 3.9-3.10, manylinux, musllinux, macOS Intel + Apple Silicon, Windows 32-bit + 64-bit + ARM...

Follow along the Easter fun at https://github.com/python-pillow/Pillow/actions/runs/8506382482 !

driscollis, to python
@driscollis@mastodon.social avatar

Did you know you adjust an image's contrast using and ?

It's true and you only need around SIX lines of code to do it too!

driscollis, to python
@driscollis@mastodon.social avatar

Did you know you can use and to adjust the contrast of your images? 🐍🔥

Here's a code example:

villares, to python
@villares@ciberlandia.pt avatar

Anyone else using #imageio instead of #Pillow for #gif export?
I had some issues with Pillow, but now I'm unhappy with the imagio palette treatment :(
https://github.com/imageio/imageio/issues/1060 #Python #GIF

MarjoleinRotsteeg, to Haiku Dutch
@MarjoleinRotsteeg@mastodon.nl avatar
pillow, to python
@pillow@fosstodon.org avatar

Pillow 10.2.0 is out!

Security fixes, deprecations, speed improvements and more. Read about it at https://pillow.readthedocs.io/en/stable/releasenotes/10.2.0.html

KayeMenner, to random
@KayeMenner@mastodon.social avatar
VK5ZSH, to blahaj

@xssfox T don't have a , but I have a 😺

Nikita like to use it to kneedle with her claws 😹

grickle, to art
@grickle@mstdn.social avatar

Tis the season to put a GNOME IN YOUR HOME! Don't wait until it's too late! A Hidden Person Pillow awaits you at gricklemart.com. Bring that icy stare into your warm house for the holidays! ONLY at https://gricklemart.com/hidden-person-pillow/

SharonCummingsArt, to art
@SharonCummingsArt@mastodon.social avatar

You don't have to fight for these pillows! My art on HOME DECOR 25% off today!

You also get 25% off of coffee mugs, towels, duvets, shower curtains, blankets, ornaments and more!

GO HERE

https://fineartamerica.com/profiles/sharoncummingsart/shop

Just select Home Decor on the left under (Department)

#art #artwork #artists #colorfulart #pillow #pillows #homedecor #sale #sales #coffee #coffeemug #coffeemugs #mug #mugs #gift #gifts #giftidea #giftideas #giftsforall #giftsforher #giftsforhim #fedigiftshop #fun #cute #AYearForArt

SharonCummingsArt, to art
@SharonCummingsArt@socel.net avatar
brentsleeper, to FiberArts
pillow, to python
@pillow@fosstodon.org avatar

Pillow 10.1.0 is out!

Python 3.12 is officially supported.

A new ImageOps.cover method has been added, that a resized version of the image, so that the requested size is covered, while maintaining the original aspect ratio.

Pillow had a “better than nothing” default font. Now, if FreeType is available, a version of Aileron Regular is loaded, which can be drawn at chosen font sizes.

Release notes:

https://pillow.readthedocs.io/en/latest/releasenotes/10.1.0.html

Enjoy!

API Additions EpsImagePlugin.gs_binary EpsImagePlugin.gs_windows_binary stores the name of the Ghostscript executable on Windows. EpsImagePlugin.gs_binary has now been added for all platforms, and can be used to customise the name of the executable, or disable use entirely through EpsImagePlugin.gs_binary = False. has_transparency_data Images now have has_transparency_data to indicate whether the image has transparency data, whether in the form of an alpha channel, a palette with an alpha channel, or a “transparency” key in the info dictionary. Even if this attribute is true, the image might still appear solid, if all of the values shown within are opaque. ImageOps.cover Returns a resized version of the image, so that the requested size is covered, while maintaining the original aspect ratio. See Resize relative to a given size for a comparison between this and similar ImageOps methods. size and font_size arguments when using default font Pillow has had a “better than nothing” default font, which can only be drawn at one font size. Now, if FreeType support is available, a version of Aileron Regular is loaded, which can be drawn at chosen font sizes. The following size and font_size arguments can now be used to specify a font size for this new builtin font: ImageFont.load_default(size=24) draw.text((0, 0), "test", font_size=24) draw.textlength((0, 0), "test", font_size=24) draw.textbbox((0, 0), "test", font_size=24) draw.multiline_text((0, 0), "test", font_size=24)
Other Changes Python 3.12 Pillow 10.0.0 had wheels built against Python 3.12 beta, available as a preview to help others prepare for 3.12, and ensure Pillow can be used immediately on release day of 3.12.0 final (2023-10-02, PEP 693). Pillow 10.1.0 now officially supports Python 3.12. Added support for DDS BC5U and 8-bit color indexed images Support has been added to read BC5U DDS files as RGB images, and PALETTEINDEXED8 DDS files as P mode images. Support reading signed 8-bit YCbCr TIFF images TIFF images with unsigned integer data, 8 bits per sample and a photometric interpretation of YCbCr can now be read.
Resize relative to a given size from PIL import Image, ImageOps size = (100, 150) with Image.open("Tests/images/hopper.png") as im: ImageOps.contain(im, size).save("imageops_contain.png") ImageOps.cover(im, size).save("imageops_cover.png") ImageOps.fit(im, size).save("imageops_fit.png") ImageOps.pad(im, size, color="").save("imageops_pad.png") # thumbnail() can also be used, # but will modify the image object in place im.thumbnail(size) im.save("imageops_thumbnail.png")

slcw, to ConspiracyTheories
@slcw@newsie.social avatar

Maybe next time don't sink your entire into absurd , and expensive that go nowhere. As a spectator, watching Mike Pillow lose it all has been very entertaining.

https://www.rawstory.com/mike-lindell-lawyers-2665810629

villares, to python Portuguese
@villares@ciberlandia.pt avatar

reading images from a with and

hugovk, to python
@hugovk@mastodon.social avatar

A little merge session for @pillow gives a nice network graph: https://github.com/python-pillow/Pillow/network

hugovk,
@hugovk@mastodon.social avatar

Colourful network graph for @pillow after 18 PRs merged in a row.
https://github.com/python-pillow/Pillow/network

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • provamag3
  • magazineikmin
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • JUstTest
  • All magazines