Wednesday, January 29, 2025

Does DeepSeek create the image from text specification?

 Conversing with DeepSeek, I was given to understand that it is not supporting creation of images. At present, it is only text.

However, it offered to create an image from text using Python and PIL. As I have been using these libraries, I gave it a try.

Here is the text specification that I used to create an image from Gemini AI [https://hodentekhelp.blogspot.com/2025/01/how-do-you-create-image-using-gemini-ai.html].

"Create an icon with the letter H decorated in yellow, with its insides filled with a web of electronic circuits. The background should be black  23-bit color with 8-bit transparency and the format in png."

Gemini AI created the following image:


Here is the suggestion from DeepSeek:

```python
from PIL import Image, ImageDraw, ImageFont

# Create a blank image with a black background and transparency
width, height = 256, 256  # Icon size
background_color = (0, 0, 0, 0)  # Black with full transparency
image = Image.new("RGBA", (width, height), background_color)

# Initialize ImageDraw
draw = ImageDraw.Draw(image)

# Draw the letter "H"
font = ImageFont.truetype("arial.ttf", 150)  # Use a system font like Arial
letter_color = (255, 255, 0, 255)  # Yellow
draw.text((75, 50), "H", font=font, fill=letter_color)

# Draw a web of electronic circuits inside the "H"
# This is a simplified representation using lines
circuit_color = (0, 255, 0, 255)  # Green for circuits
draw.line((90, 100, 90, 200), fill=circuit_color, width=2)  # Vertical linej
draw.line((90, 150, 160, 150), fill=circuit_color, width=2)  # Horizontal line
draw.line((160, 100, 160, 200), fill=circuit_color, width=2)  # Vertical line
draw.line((100, 120, 150, 120), fill=circuit_color, width=2)  # Horizontal line
draw.line((100, 180, 150, 180), fill=circuit_color, width=2)  # Horizontal line

# Save the image as a PNG file
image.save("icon_H_circuit.png", "PNG")

print("Icon created and saved as 'icon_H_circuit.png'")
```
I ran this code in PyCharm as shown:

from PIL import Image, ImageDraw, ImageFont

# Create a blank image with a black background and transparency
width, height = 256, 256 # Icon size
background_color = (0, 0, 0, 0) # Black with full transparency
image = Image.new("RGBA", (width, height), background_color)

# Initialize ImageDraw
draw = ImageDraw.Draw(image)

# Draw the letter "H"
font = ImageFont.truetype("arial.ttf", 150) # Use a system font like Arial
letter_color = (255, 255, 0, 255) # Yellow
draw.text((75, 50), "H", font=font, fill=letter_color)

# Draw a web of electronic circuits inside the "H"
# This is a simplified representation using lines
circuit_color = (0, 255, 0, 255) # Green for circuits
draw.line((90, 100, 90, 200), fill=circuit_color, width=2) # Vertical line
draw.line((90, 150, 160, 150), fill=circuit_color, width=2) # Horizontal line
draw.line((160, 100, 160, 200), fill=circuit_color, width=2) # Vertical line
draw.line((100, 120, 150, 120), fill=circuit_color, width=2) # Horizontal line
draw.line((100, 180, 150, 180), fill=circuit_color, width=2) # Horizontal line

# Save the image as a PNG file
image.save("icon_H_circuit.png", "PNG")
image.show()

print("Icon created and saved as 'icon_H_circuit.png'")

Here is the image created:

Well, given the limitations, it did create a H with a minimalist circuit (it decided the color and artwork). 

I really think, the high-end chips are needed for creating something more exotic art work or images. This said, what is the utility of imaginary sceneries with a multitude of colors, etc. 

The basic thing the AI should deliver is VALUE in the first place and in subsequent places.



No comments: