Jump to content
You must now use your email address to sign in [click for more info] ×

Convert photo to image with round pixels (limited color palette, resp. gray tones)


Recommended Posts

Hello, my name is Leonard, I am new in the forum and happy to be part of the international community here. I am from Germany and I am studying arts.

For an art project, I would like to bring a photo to a certain pixel count.
The analog artwork should later be 5 meters high and 3.696 meters wide, thus corresponding to an aspect ratio of about 3:4.
As each pixel on the wall later measures 0.8 cm, this corresponds to the dimensions of 462.5 px x 625 px.

So far, I've loaded my photo into Affinity Photo, converted it to BW, and reduced the document size to match my pixel count.

1. But now I want to reduce the color range as reasonably as possible to a total of 10-15 reasonable shades of gray. What is the best way to do that? And maybe this color range reduction makes sense BEFORE the pixel count reduction (where to get the better result)?

2. and for the visualization of the project the single pixels (will be put together later similar to a puzzle) should be "made" round. Imagine it like a mosaic with round tiles.
The background, which looks through between the round pixels, should be black or gray at the end.
(I suppose I should create a new document (with 3.7 meters x 5 meters) and scale the low-pixel photo large. So that I can then create a new layer "over" the image that "visualizes" the square pixels as round. So the new layer would be a grid with the gray background and transparent holes.

Model:

1376623133_Visualisationpixelmodel1.png.48af410736ca3af2e45f96c4abb8a165.png

 

What approach do you recommend for me? I'm sorry, unfortunately I don't know much about it yet. I am new to using Affinity Photo.

Thank you so much!

Leonard

 

------------------------------------

 

German version:

Für ein Kunstprojekt würde ich gerne ein Foto auf eine bestimmte Pixelanzahl bringen.
Das analoge Kunstwerk soll später 5 Meter hoch sein und 3,696 Meter breit, also einem Seitenverhältnis von etwa 3:4 entsprechen.
Da jeder Pixel an der Wand später 0,8 cm misst entspricht das den Maßen von 462,5 px x 625 px.

Bislang habe ich also mein Foto in Affinity Foto geladen, in BW umgewandelt und die Dokumentgröße entsprechend meiner Pixelanzahl reduziert.

1. Ich möchte nun aber möglichst sinnvoll die Farbrange auf insgesamt 10-15 sinnvolle Grautöne reduzieren. Wie mache ich das am besten? Und vielleicht macht diese Farbton-Reduzierung auch bereits VOR der Pixelanzahl-Reduzierung Sinn (wo kann man das bessere Ergebnis erzielen)?

2. Und zur Visualisierung des Projektes sollen die einzelnen Pixel (werden später analog ähnlich wie ein Puzzle gesteckt) rund "gemacht" werden. Man stelle sich das vor wie ein Mosaik mit runden Fliesen.
Der Hintergrund, der jeweils dann zwischen den runden Pixeln durchschaut soll am Ende schwarz oder grau sein.
(Ich nehme an, ich sollte ein neues Dokument (mit 3,7 Meter x 5 Meter) anlegen und das niedrigpixelige Foto groß skalieren. Sodass ich im Anschluss eine neue Ebene "über" das Bild erstellen kann, der die quadratischen Pixel "rund visualisiert". Die neue Ebene wäre also ein Raster mit dem grauen Hintergrund und transparenten Löchern.

Modell:

(siehe oben)


Welche Vorgehensweise empfehlt ihr mir? Es tut mir Leid, leider kenne ich mich noch nicht so sehr aus. Ich bin neu im Umgang mit Affinity Photo.

Vielen Dank!

Leonard

Link to comment
Share on other sites

5 minutes ago, Le0nard said:

1. But now I want to reduce the color range as reasonably as possible to a total of 10-15 reasonable shades of gray. What is the best way to do that? And maybe this color range reduction makes sense BEFORE the pixel count reduction (where to get the better result)?

Your best bet would be to use the Levels Adjustment layer and change the Output Black and or White to get it down to an acceptable number. I don't think it will be easy to get a precise number of levels, say 12. Just remember that % is 0 to 100 and the greyscale is 0 to 255. so some math will be required.

1264444259_ScreenShot2022-12-28at9_18_35AM.png.e9e462a7109902b9995a565415e50aed.png

Mac Pro (Late 2013) Mac OS 12.7.6 
Affinity Designer 2.5.5 | Affinity Photo 2.5.5 | Affinity Publisher 2.5.5 | Beta versions as they appear.

I have never mastered color management, period, so I cannot help with that.

Link to comment
Share on other sites

2 hours ago, Old Bruce said:

Your best bet would be to use the Levels Adjustment layer and change the Output Black and or White to get it down to an acceptable number.

Can you explain a bit more about what's happening there? I don't think I've ever seen Levels Adjustments used for posterization. I would have expected a conversion to B/W followed by a Posterization Adjustment, I think.

-- Walt
Designer, Photo, and Publisher V1 and V2 at latest retail and beta releases
PC:
    Desktop:  Windows 11 Pro 23H2, 64GB memory, AMD Ryzen 9 5900 12-Core @ 3.00 GHz, NVIDIA GeForce RTX 3090 

    Laptop:  Windows 11 Pro 23H2, 32GB memory, Intel Core i7-10750H @ 2.60GHz, Intel UHD Graphics Comet Lake GT2 and NVIDIA GeForce RTX 3070 Laptop GPU.
    Laptop 2: Windows 11 Pro 24H2,  16GB memory, Snapdragon(R) X Elite - X1E80100 - Qualcomm(R) Oryon(TM) 12 Core CPU 4.01 GHz, Qualcomm(R) Adreno(TM) X1-85 GPU
iPad:  iPad Pro M1, 12.9": iPadOS 17.7, Apple Pencil 2, Magic Keyboard 
Mac:  2023 M2 MacBook Air 15", 16GB memory, macOS Sonoma 14.7

Link to comment
Share on other sites

I think after the conversion to greyscale and the adjustment of the output levels, a Halftone Filter may get you close to where you want:

1333863170_Screenshot2022-12-28at21_05_49.thumb.png.9c88217731507f7f8d64475da8978224.png

(Screen: Monochrome; Dot: Round; Screen Angle: 0º. Cell size to suit your requirements.)

 

Affinity Photo 2.5.3,  Affinity Designer 2.5.3, Affinity Publisher 2.5.3, Mac OSX 14.5, 2018 MacBook Pro 15" Intel.

Link to comment
Share on other sites

Hi @Le0nard

This is complicated. Watch this video before continue reading. It's a PS video but it will give you a better understanding of what we're trying to replicate in A.Photo.

The first step is to pixelate the image (Filters > Distort > Pixelate).
On my example, i decided to make the "square pixels" 40px wide. For best results, this value varies and not all images look good with this technique.

pixelate.png.e73dffac1dcd73081ab88ae325efef69.png

Next you need to create the "round pixels" but first i recomend watching a video about the function "Power Duplicate"

Your first "round pixel" must have exactly 40px wide and centered in the middle of the "square pixel".

ellipse.png.8d4d8a7ab4250dd4756d3e66462ed7ab.png

After Power duplicate you must have something like this. I grouped all the "round pixels" and applied "Rasterise".

PowerDuplicateB.jpg.675e1f65ba67bbe108ceb7cd5f54562f.jpg

Load your "round pixels" as a selection (Ctrl + Mouse_click on layer thumbnail) and add a mask to your background.
This was my final result. I used black as background colour.

Final.jpg.d3bb6bbf1e61f566f9bf86e580fcc3bd.jpg


To convert to B&W add a B&W adjustment set to Colour blend mode.
To restrict the shades of gray to... lets say 15, add a Posterise adjustment set to 15 levels.
The posterise adj. set to 15 on a B&W image does not convert the image to 15 shades of gray. What it does is set the maximum number of possible shades of gray to a value of 15. (If it has 13 shades probably no one will notice 😀)

Link to comment
Share on other sites

First of all, thank you @Old Bruce, @walt.farrell, @h_d, @Lisbon so much for your answers!

@h_d This looks also nice but isn't exactly what I'm searching for! But maybe I can use it another time! 🙏🏽

@Lisbon Wow, THAT'S IT. Absolutely. This looks actually great. I'm too busy this afternoon but I will try all these steps tomorrow. Thank you also for sharing these helpful videos! Because I really need to advance with my affinity knowledge and skills..

I will share my further experiences with my project and I'm sure asking for more help!

Leonard

Link to comment
Share on other sites

Brilliant workflow, @Lisbon, but…

3 hours ago, Lisbon said:

I grouped all the "round pixels" and applied "Rasterise".

… you don't even need to rasterize anything:

  1. after you have duplicated all your ellipses: Layer > Geometry > Merge Curves = you'll get a single vector Curves layer
  2. mask your pixelated image with the Curves layer (a.k.a. vector mask)

aph_round_raster_vector_mask.png.d90f521ef126b814f90ad4436d7e7752.png

MacBookAir 15": MacOS Ventura > Affinity v1, v2, v2 beta // MacBookPro 15" mid-2012: MacOS El Capitan > Affinity v1 / MacOS Catalina > Affinity v1, v2, v2 beta // iPad 8th: iPadOS 16 > Affinity v2

Link to comment
Share on other sites

11 minutes ago, loukash said:

you don't even need to rasterize anything

That said though…
It also depends on how the image will be exported.

E.g. on PDF export, a vector mask will – logically – give a different result than a pixel mask. 
Thus, also to consider are certain rendering bugs and flaws within the PDF export module (sad but true) as well as the exact PDF settings like downsampling etc.

MacBookAir 15": MacOS Ventura > Affinity v1, v2, v2 beta // MacBookPro 15" mid-2012: MacOS El Capitan > Affinity v1 / MacOS Catalina > Affinity v1, v2, v2 beta // iPad 8th: iPadOS 16 > Affinity v2

Link to comment
Share on other sites

20 minutes ago, Lisbon said:

alternative solutions

What I'm often observing here: People who are coming from (more or less strict) bitmap based solutions, i.e. even from Photoshop, they often keep forgetting the powerful vector tools within the Affinity universe, while attempting to replicate their previous bitmap based workflows which they are so used to. Not to speak of the seamless interoperability between the three Affinity apps which is – in my book – the killer feature.

Thinking out of the box is a Good Thing™… :) 
Hey, been there done that myself. It took me a few years to realize it since I first started with Designer in 2014…

MacBookAir 15": MacOS Ventura > Affinity v1, v2, v2 beta // MacBookPro 15" mid-2012: MacOS El Capitan > Affinity v1 / MacOS Catalina > Affinity v1, v2, v2 beta // iPad 8th: iPadOS 16 > Affinity v2

Link to comment
Share on other sites

It gets even better: ;) 

aph_round_raster_vector_clipped.png.93b55c4e3a421e48c8c61835e118b130.png

While masking may still rasterize on PDF export, clipping the image with the vector dots won't.
You'll get nice vector ellipses, each filled with a solid color tint (albeit pixels).

To make it full vector, you may need to trace the pixelated bitmap image outside Affinity first. There are even free online services that can do that, see this list.

This is now full vector:

aph_round_raster_vector_clipped_vectorized.png.f4afb1a914dd0ac425adecc804270714.png

Traced quickly via autotracer.org which is … not all that great and clean for this complex image, but perhaps others can do a better job. (I still have Illustrator CS5 which likely would do a better job at tracing if set up correctly for this type of image, but that takes time…)

MacBookAir 15": MacOS Ventura > Affinity v1, v2, v2 beta // MacBookPro 15" mid-2012: MacOS El Capitan > Affinity v1 / MacOS Catalina > Affinity v1, v2, v2 beta // iPad 8th: iPadOS 16 > Affinity v2

Link to comment
Share on other sites

18 hours ago, loukash said:

… you don't even need to rasterize anything:

  1. after you have duplicated all your ellipses: Layer > Geometry > Merge Curves = you'll get a single vector Curves layer
  2. mask your pixelated image with the Curves layer (a.k.a. vector mask)

In this case I will have vector-circles which are really "round"? Because I did this step...

22 hours ago, Lisbon said:

The first step is to pixelate the image (Filters > Distort > Pixelate).

... with only 8 pixels and they're not really round:

1628667888_Bildschirmfoto2022-12-30um16_45_25.thumb.png.4fcdbb7503299a9f8ce021f906885c7e.png

 

1326162066_Bildschirmfoto2022-12-30um13_49_19.thumb.png.0b4c75f67e055b75137dab9f8a59ac47.png

But in general I did everything right?

Would be great if I could do it like vectors which are perfect round...

 

OT: My Mac (MacBook Pro - 14", 2021 - M1 Pro - 16 GB - Ventura 13.0.1) had problems by doing the duplicate part. My solution was to create groups and rasterize blockwise. But is this normal? I mean these are only some pixels (well, each is a layer) and my MacBook is NEW. 

 

Edited by Le0nard
Link to comment
Share on other sites

54 minutes ago, lacerto said:

I am not sure if I understood your goal properly

As far as I understood it, each ellipse should be just one solid color, i.e. a raster dot. Hence the image needs to be pixelated first.

MacBookAir 15": MacOS Ventura > Affinity v1, v2, v2 beta // MacBookPro 15" mid-2012: MacOS El Capitan > Affinity v1 / MacOS Catalina > Affinity v1, v2, v2 beta // iPad 8th: iPadOS 16 > Affinity v2

Link to comment
Share on other sites

Well, power duplicating 0.8 cm circles for a 3.696 x 5 meters image can be somehow pretty tidious. Thus I would let that boring work part be done via some Python scripting or the like. As an example a small py-script can do such circle grid imaging work faster & better ...

import random
from PIL import Image, ImageDraw

coords = [
    (x, y)
    for x in range(0, 13969, 30)
    for y in range(0, 18898, 30)
]

im = Image.new('RGB', size=(13969, 18898))
draw = ImageDraw.Draw(im)

for (x, y) in coords:
    draw.ellipse(
        [(x, y), (x + 30, y + 30)],
        fill=(random.randint(128, 255),0,0)
    )

imgGray = im.convert('L')
imgGray.save('yourname_of_gray_circles.png')

... the above would generate a slightly huge 13969 x 18898 pixel file (~ 3.696 x 5 meters in pixel, with a circle size of 0,8 cm = ~ 30 pixels), with random filled pixel colors converted to grayscale (could be adjusted to a desired grayscale color range instead) ...

... which when generated as a small 600 x 600 px image instead would look like this ...

grid_of_random_gray_circles.png.9d3a8769d7d9d0d362976e13b31fb671.png

Of course one could instead let draw on a transparent background, or let the whole be generated as a vector based SVG file instead of bitmap graphics etc.

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

40 minutes ago, lacerto said:

It indeed can be that. My laptops are rather basic, and power duplication became sluggish when producing the kind of 0.8cm full width and height ellipse mesh, though I did not probably do duplication in the most effective way. I also noticed that trying to clone ellipses in Inkscape was very slow (and might make the app unresponsive) when trying to produce meshes with hundreds of ellipses both per row and column (in Inkscape max 500 copies is the limit for either). ...

Jip, there are often common tasks one can easier, more precise and overall better solve via letting a computer program doing all the painful and boring work here.

40 minutes ago, lacerto said:

Today I wrote a Python script that creates color or grayscale coloring bitmap with the width and height based on number of ellipses wanted per row and column, and then creates 30px (roughly 8mm at 96dpi) ellipses. In addition to coloring maps (that can be used as bitmap fills in Affinity apps in context of the Gradient Tool), the routine also saves the results both as PNGs and SVGs (vector format). The script was written in Python 3 10.5 and the SVG output requires installation of Cairo library.

Python is a pretty perfect playground for such things, since there is a big amount and rich set of reusable graphics modules (libraries) for mostly every mathematical and graphical aspect available, be it bitmap or vector graphics. - Due to that Python got overall very powerful and offers quick turnarounds (quick functional prototyping) for such things.

40 minutes ago, lacerto said:

Python script would allow fairly easy addition of all kinds of variations and would be quite useful if it were enhanced with argument handling. It would be very effective in processing multiple images and whenever the ellipse mesh consists of as many elements as in the OP's example. ...

Argument handling is usually pretty easy to add and adapt when using the "argparse" module. Though it can also be done with the "sys" module, but "argparse" would always be my first choice here, in order to resemble a proper command-line interface as known from common CLI-applications.

A good solution and nicely and well done in Python! 👍

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

  • 3 months later...

@Le0nard

Kannst Du bitte erläutern wie die Datei in ein physisches Kunstwerk übertragen werden soll? Es gibt m.w. Kein Gerät was Pixel von 80cm Durchmesser erzeugen kann.

Drucker, Lasercut, oder Handwerkliche Umsetzung?

Du hast Eingangs erwähnt dass es quasi Puzzle-Stücke werden sollen, und die Stücke runde Scheiben sind. Der Hintergrund muss also gar nicht in der Datei vorhanden sein (bei Raster-Dateien kommen sonst anti-alias Effekte).

Bleibt  es bei Graustufen, oder werden die Stücke umgefärbt (was Du im anderen Thread angesagt hast)?

Ich hab das Gefühl das da grad einiges durcheinander geht, und wir ggf viel einfachere Wege finden können.

Ich denke es werde 2 Dateien (Versionen) benötigt:

1. eine Simulation wie das am Ende aussehen wird. Diese benötigt eine viel höhere Auflösung, um Kreise darzustellen

2. die Datei, aus welcher das Kunstwerk dann physisch abgeleitet wird. Für jede Farbfläche wird nur ein Pixel benötigt, da nur die Farbe relevant ist

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

My posts focus on technical aspects and leave out most of social grease like „maybe“, „in my opinion“, „I might be wrong“ etc. just add copy/paste all these softeners from this signature to make reading more comfortable for you. Otherwise I’m a fine person which respects you and everyone and wants to be respected.

 

Link to comment
Share on other sites

12 hours ago, NotMyFault said:

was Pixel von  80cm  80mm Durchmesser erzeugen kann.

On 12/28/2022 at 6:03 PM, Le0nard said:

As each pixel on the wall later measures 0.8 cm, this corresponds to the dimensions of 462.5 px x 625 px.

0.8 cm = 80 mm  und  462.5 px x 625 px  = ~ 3.95 cm x 5.29 cm

☛ Affinity Designer 1.10.8 ◆ Affinity Photo 1.10.8 ◆ Affinity Publisher 1.10.8 ◆ OSX El Capitan
☛ Affinity V2.3 apps ◆ MacOS Sonoma 14.2 ◆ iPad OS 17.2

Link to comment
Share on other sites

5 hours ago, v_kyr said:

0.8 cm = 80 mm  und  462.5 px x 625 px  = ~ 3.95 cm x 5.29 cm

Ok, hatte die falsche Einheit.

Es bleibt die Kernfrage was mit „Pixel“ gemeint ist, bzw wie der Übergang vom digitalen Dokument zu den physischen runden Objekten passieren soll.

Ein digitales Pixel kann vom Ausgabegerät als eckig (display, Projector) oder rund (Tintendrucker). Oder man kann die Datei massiv hochskalieren um mit vielen Pixeln kreisförmige Kacheln erzeugen lassen. 
 

Zu guter letzt soll das Kunstwerk „gesteckt“, als aus kleineren Abschnitten zusammengesetzt werden. Im parallelen Thread wurde nach umfärben gefragt. Oder anders gefragt: soll das „rundmachen“ im digitalen simuliert werden? Oder passiert das en passent dirch die gewählten Ausgabegeräte?

On 12/28/2022 at 6:03 PM, Le0nard said:

2. Und zur Visualisierung des Projektes sollen die einzelnen Pixel (werden später analog ähnlich wie ein Puzzle gesteckt) rund "gemacht" werden. Man stelle sich das vor wie ein Mosaik mit runden Fliesen.
Der Hintergrund, der jeweils dann zwischen den runden Pixeln durchschaut soll am Ende schwarz oder grau sein.
(Ich nehme an, ich sollte ein neues Dokument (mit 3,7 Meter x 5 Meter) anlegen und das niedrigpixelige Foto groß skalieren. Sodass ich im Anschluss eine neue Ebene "über" das Bild erstellen kann, der die quadratischen Pixel "rund visualisiert". Die neue Ebene wäre also ein Raster mit dem grauen Hintergrund und transparenten Löchern.

 

Mac mini M1 A2348 | Windows 10 - AMD Ryzen 9 5900x - 32 GB RAM - Nvidia GTX 1080

LG34WK950U-W, calibrated to DCI-P3 with LG Calibration Studio / Spider 5

iPad Air Gen 5 (2022) A2589

Special interest into procedural texture filter, edit alpha channel, RGB/16 and RGB/32 color formats, stacking, finding root causes for misbehaving files, finding creative solutions for unsolvable tasks, finding bugs in Apps.

My posts focus on technical aspects and leave out most of social grease like „maybe“, „in my opinion“, „I might be wrong“ etc. just add copy/paste all these softeners from this signature to make reading more comfortable for you. Otherwise I’m a fine person which respects you and everyone and wants to be respected.

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.