this post was submitted on 14 Jan 2024
0 points (NaN% liked)

196

19358 readers
98 users here now

Be sure to follow the rule before you head out.


Rule: You must post before you leave.



Other rules

Behavior rules:

Posting rules:

NSFW: NSFW content is permitted but it must be tagged and have content warnings. Anything that doesn't adhere to this will be removed. Content warnings should be added like: [penis], [explicit description of sex]. Non-sexualized breasts of any gender are not considered inappropriate and therefore do not need to be blurred/tagged.

If you have any questions, feel free to contact us on our matrix channel or email.

Other 196's:

founded 3 years ago
MODERATORS
 
top 7 comments
sorted by: hot top controversial new old
[–] PM_ME_VINTAGE_30S@lemmy.sdf.org 2 points 2 years ago* (last edited 2 years ago) (2 children)

I created this on my phone in MATLAB. You can probably do this in Octave with similar or the same code.

Figure 2024-01-14 17_18_24~2

First, I downloaded the image from Lemmy, then uploaded it into my MATLAB app. I renamed the image to image.jpg, then ran the following code:

image=imread("image.jpg") imagesc(log10(abs( fftshift(fft2(image)) )))

fft2 applies a 2D Fast Fourier transform to the image, which creates a complex (as in complex numbers) image. abs takes the magnitude of the complex image elementwise. log10 scales the result for display.

Then I downloaded the image from the MATLAB app, went into the Photos app and (badly) cropped out the white border.

Despite how dramatically different it looks, it actually contains the same [1] information as the original image. Said differently, you can actually go back to the original with the inverse functions, specifically by undoing the logarithm and applying the inverse FFT.

[1] Almost. (1). There will be border problems potentially caused by me sloppily cropping some pixels out of the image. (2). It looks like MATLAB resized the image when rendering the figure. However, if I actually saved the matrix (raw image) rather than the figure, then it would be the correct size. (3) (Thank you to @itslilith@lemmy.blahaj.zone for pointing this out.) You need the phase information to reconstruct the original signal, which I (intentionally) threw out (to get a real image) when I took the absolute value but then completely forgot about it.

[–] itslilith@lemmy.blahaj.zone 1 points 2 years ago

don't you lose information by taking the abs(), since to restore the full information you need both complex and imaginary parts of the fft? You could probably get away with encoding Re and Im in different color channels tho

[–] asbestos@lemmy.world 1 points 2 years ago* (last edited 2 years ago)

Can guarantee OP didn’t expect this when he was making the post, damn

[–] HerbalGamer@sh.itjust.works 0 points 2 years ago (1 children)

Hold on this is gonna take some time but I might just try this and post in a few weeks

[–] HerbalGamer@sh.itjust.works 0 points 2 years ago (1 children)

Now we wait and see what I come up with

[–] Otherwise_Direction7@monyet.cc 0 points 2 years ago (1 children)

I will watch your progress with the great interest

[–] HerbalGamer@sh.itjust.works 1 points 2 years ago

Okay hold on; I did it in a few hours, not weeks but it gets freaky fast:

  1. Played around with the lines; erasing a few bits and rounding off some corners.

  2. Did the outlines in marker

  3. First bit of shading

  4. Left it overnight. Came back today and started building up the shades and lines

  5. Bit more

  6. Bit more and now I think I'm done.