this post was submitted on 14 Jan 2024
96 points (100.0% liked)

196

16477 readers
2137 users here now

Be sure to follow the rule before you head out.

Rule: You must post before you leave.

^other^ ^rules^

founded 1 year ago
MODERATORS
 
all 32 comments
sorted by: hot top controversial new old
[–] PM_ME_VINTAGE_30S@lemmy.sdf.org 39 points 10 months ago* (last edited 10 months ago) (4 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.

[–] asbestos@lemmy.world 20 points 10 months ago* (last edited 10 months ago)

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

[–] itslilith@lemmy.blahaj.zone 12 points 10 months ago (1 children)

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

[–] PM_ME_VINTAGE_30S@lemmy.sdf.org 4 points 10 months ago

Correct. I updated my comment.

[–] Otherwise_Direction7@monyet.cc 5 points 10 months ago

Ok, this is really mad cool, I like it

[–] HerbalGamer@sh.itjust.works 4 points 10 months ago

Saving this comment in case I ever need a new phone background.

[–] Jackie_meaiii@lemmy.blahaj.zone 30 points 10 months ago (3 children)

I used the default photos app on my phone to draw a totally normal cow

[–] PM_ME_VINTAGE_30S@lemmy.sdf.org 12 points 10 months ago

So I took your image and ~~ruined my MATLAB account~~ used the most normal part of your totally normal cow as a 3D [1] ~~cockvolution~~ convolution kernel. So in some sense, I dragged the red and purple part all across your image and added up the results. Here's the result:

Figure 2024-01-15 14_46_27

Here's the MATLAB code:

normal_image = imread("totally_normal_image.png");

feature=normal_image(272:350,205:269,:);

feature_expansion = padarray(feature,[0,ceil((79-65)/2),0],'replicate');

for m = 1:1:3

new_normal_image(:,:,m) = conv2(normal_image(:,:,m),feature_expansion(:,:,m));

new_normal_image(:,:,m) = new_normal_image(:,:,m)/max(max(new_normal_image(:,:,m))); 

end

imshow(new_normal_image)

[1] The original image was practically grayscale, so only a 2D convolution is required, i.e. over 2 spatial dimensions. Since you added color, it adds a extra dimension, one per color channel. Which makes it more annoying to work with in MATLAB. I mean, I could have just dumped everything into grayscale, but I need practice with processing color images anyways.

[–] adj16@lemmy.world 7 points 10 months ago

This is so f’n weird, I love it

[–] Otherwise_Direction7@monyet.cc 5 points 10 months ago (2 children)

Is that supposed to be a blood on the bottom right?

[–] EvokerKing@lemmy.world 9 points 10 months ago

I think it's a little more nsfw

[–] PM_ME_VINTAGE_30S@lemmy.sdf.org 6 points 10 months ago

I mean there's blood inside the red thing.

[–] Pudutr0n@feddit.cl 29 points 10 months ago (1 children)

over 9000 hours on paint

spoiler.net

[–] Otherwise_Direction7@monyet.cc 12 points 10 months ago

9000 hours well spent

[–] JigglypuffSeenFromAbove@lemmy.world 14 points 10 months ago (1 children)

I used an app on my phone to draw over the image and made a cow twerking at the disco.

[–] Otherwise_Direction7@monyet.cc 8 points 10 months ago

Oddly specific but ok

[–] Rebels_Droppin@lemmy.world 12 points 10 months ago (3 children)

I mirrored the image and added scanlines

[–] PM_ME_VINTAGE_30S@lemmy.sdf.org 9 points 10 months ago

No, you gave it a dump truck

[–] Otherwise_Direction7@monyet.cc 8 points 10 months ago (1 children)

This could be a logo for a hacker group or a scene group

[–] Rebels_Droppin@lemmy.world 3 points 10 months ago

Lol yeah I can see it working for either of those!

[–] HerbalGamer@sh.itjust.works 6 points 10 months ago

Bulls in Spaaaace!

[–] WeLoveCastingSpellz@lemmy.dbzer0.com 12 points 10 months ago (1 children)

holly ahit open source drawing

[–] Otherwise_Direction7@monyet.cc 5 points 10 months ago

Free and open-source baby, powered by CC BY-NC content license

[–] HerbalGamer@sh.itjust.works 11 points 10 months 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 10 points 10 months ago (2 children)

Now we wait and see what I come up with

[–] Otherwise_Direction7@monyet.cc 6 points 10 months ago (1 children)

I will watch your progress with the great interest

[–] HerbalGamer@sh.itjust.works 20 points 10 months ago (2 children)

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.

[–] HerbalGamer@sh.itjust.works 9 points 10 months ago* (last edited 10 months ago) (1 children)

Also my friend asked for a drawing of some mushrooms so I think I'm gonna use the same template for that :)

Can we do these more often? This is fun! :D

[–] webghost0101@sopuli.xyz 2 points 9 months ago (1 children)

What community would fit something like this?

[–] HerbalGamer@sh.itjust.works 1 points 9 months ago

Good question; probably its own?

[–] Otherwise_Direction7@monyet.cc 4 points 10 months ago

Looks like a monster for a JRPG, pretty cool and well drawn