Monday 1 May 2023

AI Tools - coding and photos

As it was to be expected, it did not take long before my attention drifted towards a coding topic. I sometimes post here a collection of photos and I usually prepare them manually.

With this in mind, I had a short conversation with ChatGPT as per below:

Q: I know a bit of python. I would like to make a jupyter notebook that allows me to select images in my computer and make a collage with them. Can you help with this and explain your choice of libraries?

A: ... [some python code]

Q: the notebook should handle rows and columns and images in the collage should have a white margin as separation. Can you rewrite the notebook?

A: ... [some python code]

Q: images should be accepted as jpg or png

A: ... [some python code]

Q: I am writing python code. I have an image of size (x,y) and would like to resize to size (a,b) so that image is centered in new dimension. How would you do this?

A: ... [some python code]

Q: Thanks

A: You're welcome! Let me know if you have any further questions.

I still had to change the code quite a bit to make it work but it definitely helped. Strangely enough, I never say thanks to my car for taking me from one place to another but it seemed reasonable to say Thanks to ChatGPT.

So some examples generated quickly. I like it that photos are now perfectly aligned and centered and I can play a bit with the margin width.


PS: If you follow me in IG you may have noticed that a couple of pictures have not been posted yet.

No comments: