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>
villares, to genart Portuguese
@villares@ciberlandia.pt avatar

If you missed my #PyConUS24 tutorial on #CreativeCoding, maybe you could watch my Domestika course:

https://www.domestika.org/pt/courses/4307-design-com-python-programacao-para-um-contexto-visual/a_b_a_villares

15% off with code A_B_A_VILLARES-PYCONUS up to June 19th #PyConUS (anyone can use this, you don't need to have been at PyCon!)

villares, to random
@villares@ciberlandia.pt avatar

Creative Coding with #py5 at #PyConUS24 room 301-305 in a few minutes!!!

villares,
@villares@ciberlandia.pt avatar

Sunday 11AM: #CreativeCoding #py5 open space at #PyConUS24 #PyCon room 315

villares, to random
@villares@ciberlandia.pt avatar

Best picture so far, taken by @brass75 at #PyConUS24

py5coding, to random
@py5coding@fosstodon.org avatar

Tomorrow (Saturday) at PyCon US 2024: Creative Coding with py5, the Python version of Processing, at 4:15 in Room 301-305

https://us.pycon.org/2024/schedule/presentation/167/

#pycon #pycon2024 #py5 #processing

villares,
@villares@ciberlandia.pt avatar

@py5coding today! don't miss it. And tomorrow a #CreativeCoding open space at #PyConUS, keep tuned for more info #pyconus24

villares, (edited ) to random
@villares@ciberlandia.pt avatar

today at my phone got swept by Tornado/High Wind warning alerts... hard to turn then off... hundreds and hundreds of message dialogs...

kushal, to python
@kushal@toots.dgplug.org avatar

I found the keynote speakers #PyConUS #PyConUS24. #python

pyOpenSci, to python
@pyOpenSci@fosstodon.org avatar

This weekend is the perfect time to apply to the #pyConUS24 Maintainers Summit! Organized by @feynudibranch, @inessapawson, and @leahawasser, the Maintainers Summit brings together the #Python community to share best practices in developing sustainable projects and nurturing thriving communities.

Learn more and apply: https://bit.ly/pyOSpyCon2024

Proposals from first-time speakers and Pythonistas from underrepresented groups are strongly encouraged.

Questions? Drop ‘em in the comments!

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