Wednesday, 3 May 2023

2023 - 1998 = 25

1998 fue un año intenso para mí. Justo hoy hace veinticinco años llegué a Cranfield para hacer el proyecto fin de carrera allí. Lo cual quiere decir que llevo media vida fuera de España.

Cuantas vueltas y cuantas cosas buenas me han pasado en estos veinticinco años...

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.

Sunday, 30 April 2023

AI tools

 


Unlike most photos in this blog, the one above was not taken by me. In fact, it is not even a photo as it was generated with an AI tool. First I used ChatGPT to make a summary of a long text so that I could use it as a prompt in Blue Willow to generate an image. The prompt was an impressive good summary of the text, and after some tweaking I got an image which was acceptable (somehow there are not many photos of bookshops and instead libraries and law firms keep coming up).

In any case, interesting what can be done these days.

Input for ChatGPT:

Make a summary of following text so that I can use it as a prompt for DALL-E to generate an image. "long text here"

Output (note some mistakes in the summary, she leaves the bookshop with the note, not JC):

A man named JC goes to a bookshop in downtown Berlin to leave a booklet of his short stories on a shelf. He is worried that the book may be thrown away, but he decides to stay and watch over it. A young woman eventually picks up the book, reads it, and takes it with her. JC leaves the bookshop with a handwritten note asking the woman to bring it back when she is finished so that others can enjoy it too. The bookshop is Hugendubel in the Schlossstrasse.

Final prompt for Blue Willow after several attempts:

Generate a black and white image with a young man and a young woman in a bookshop. The woman is in the foreground and she is standing reading a book on her hands. The man is in the background, sitting on a sofa. He is watching the woman.

Not quite what I had in mind when I wrote that short story and still quite impressive considering the (lack of) effort required to generate the image.

Speacial thanks to https://www.youtube.com/@Laura_tech for pointing me to some of the tools.