return to table of content

Ugly Avatar

ggorlen
11 replies
1d

Fantastic, but unfortunately the source code is minified: https://github.com/txstc55/ugly-avatar, making it difficult to see how it was done and learn from or contribute to the project.

enahs-sf
4 replies
1d

I just looked at the source map in the browser — you can check it out there.

ggorlen
3 replies
23h29m

Thanks! I found the Vue source in Firefox by going into the Debugger tab in DevTools, and clicking on Sources > Webpack > ugly-face > src.

Chrome makes it a bit more intuitive, since the tab is called Sources, then click into Page > top > ugly-face > src.

That said, I don't understand why the author didn't simply commit the source code into the GH repo, especially since it's fully retrievable anyway. Maybe there's some goal in doing that other than security by obscurity I'm missing, since they've followed the same pattern for multiple of their repos. It seems kind of anti-collaborative to me.

txstc55
2 replies
22h43m

I believe for avatar generations i have including this one, three of them. I thought i pushed the code already. For any code that requires a database access I don't push the code

ggorlen
1 replies
19h36m

Thanks, I appreciate seeing the code! For code with database access, you could use an environment variable from a .env file and gitignore that file, making it safe to share. (you're probably already aware of this practice and may have another reason not to want to push it)

txstc55
0 replies
19h13m

For things working with database I mainly don’t want to expose the rpc calls or the database queries. I know people can just get it by checking dev tool but it’s one layer of labor and can filter out many people with millacious intent

ithkuil
1 replies
21h56m

You mean uglified

BMorearty
0 replies
20h49m

hee hee

hn_acker
1 replies
20h45m

Additionally, there's no copyright license on the files. (Tangent: even if there were a free software license, the software wouldn't be free software by the FSF's definition (https://www.gnu.org/philosophy/free-sw.en.html) because source code is the form that the author prefers when the author modifies the software, and minified code usually is not that.)

txstc55
0 replies
19h12m

You are right, I probably should have a copyright file there, just so that if people use this project they have to cite me, other than that I don’t care about how people use it

KTibow
1 replies
20h21m

You can change the branch to main and see the code. (I agree that having the pages branch as the default branch and uploading built code instead of building it with a GH action is still odd)

ggorlen
0 replies
19h50m

It's there now (thanks for the alert!), but I don't think the main branch was there when I wrote the parent comment. If I recall correctly, it was just the gh-pages branch like these other repos from OP: https://github.com/txstc55/Ducked-support and https://github.com/txstc55/duck-duck-duck.

(Of course, those repos may have main pushed later as well, invalidating this comment too)

Nice of the author to share the code. Thanks!

blastro
9 replies
23h57m

Looks like the animation style of the cartoon "Home Movies" - seriously underrated show. Jon H Benjamin is the voice of the main character.

Klonoar
2 replies
22h23m

Err, that’s if you consider McGuirk the main character. Which sometimes I could see, haha.

Small voiced his namesake in that cartoon.

saghm
1 replies
21h19m

Yeah, as much as McGuirk is my favorite character on that show, I think it's a bit of a stretch to call him the main character. He's definitely the most recognizable voice from the show though!

flymasterv
0 replies
18h36m

The grill is really the main character.

slmjkdbtl
0 replies
15h18m

Home Movies carried me through the pandemic, fond memories of the show

ozzmotik
0 replies
19h1m

Brendon Small voices the main character. H Jon Benjamin is one of the supporting characters (coach McGuirk)

nozzlegear
0 replies
19h55m

I remember watching this show at 3am as a teenager, while my sister and I ate breakfast before heading out to our jobs on a dairy. We did not like this show, but it was really the only thing that was on at 3am. It was followed by The Oblongs which we vaguely remember as bizarre and joke about it being a shared dream we must’ve had when we fell asleep on the job.

joemi
0 replies
23h12m

I immediately thought the same and figured I just got one that looked kind of like that to start of with, and reloaded and reloaded and reloaded and was so pleased when I just kept getting ones that looked like Home Movies. Because of that, they all strike me as charming and amusing more than they do ugly.

crabmusket
0 replies
20h9m

Brilliant show. I grew up watching Science Court by the same creators. It's got a very sly sense of humour.

arjan_sch
7 replies
1d1h

Nice project. Would be good to add a bit more diversity to the skin tones though :)

whatshisface
5 replies
1d1h

It would get this guy absolutely murdered if one of the funny faces looked racist.

mock-possum
1 replies
22h2m

Can we not do that here please

The whole “you’re not allowed to do anything these days for fear of being accused of being racist” thing

whatshisface
0 replies
21h15m

You can't please everybody, which leaves your conscience as the deciding factor. If you would rather not draw black people with googly eyes and vacant expressions, I can hardly criticize that. Like you point out, you'll get criticized - but again, it's impossible to make everyone satisfied with this stuff.

hateful
1 replies
23h58m

If you had the Dark Reader extension enabled like I did when I first went to the site...

zwirbl
0 replies
23h50m

I didn't even realize until I read your comment

braingravy
0 replies
22h50m

Ya you’re right brown people can’t be included in funny or silly things. Good call good call.

trallnag
0 replies
1d

Too risky

EGreg
5 replies
1d1h

What are some of the best libraries that would generate an avatar in PHP directly?

Or in Javascript?

I don't want to have to hit any APIs.

sph
0 replies
1d1h

ImageMagick?

jaynetics
0 replies
23h58m

If you want to deterministically generate avatars for your users, you're looking for "identicons". Googling that will yield several libraries for any common language.

hiccuphippo
0 replies
1d1h

You could generate svg.

doublerabbit
0 replies
23h23m

PHP is nice with GD or ImageMagick.

Make a circle.png

Use GD to overlay colour over the radius of the circle

Apply facial details

Then finally anything extra

Menu_Overview
0 replies
23h22m

You'll need a library that can render to some 2D-context that can then be converted to PNG.

JS is probably where you should look. You might be able to find a good PHP drawing library but I've never come across that in my work. Lots of image converting libraries out there (usually just a wrapper around ImageMagik), but "drawing images" usually a client-side thing and you'll find more support for it.

In JS, you'll draw the image to a `<canvas>` element, which can then be downloaded as a PNG. You could go the SVG route, too, depending on the art style. Canvas is the safer bet.

mike986
3 replies
22h20m

very entertaining.

if it's not a lot, can you have another UI that display more than one avatar at a time? say, 3x3 or 4x3 grid?

Thanks

txstc55
2 replies
22h1m

It’s not hard but I don’t see the use of this, so probably not. And also although it doesn’t seem like it but the computation is quite intense for them, having multiple will lag the browser

mike986
1 replies
21h46m

no worry.

maybe i'll explain why, it's like the finding a mate for marriage problem. you dates enough ppl to have a taste of what you like, and then for the next one that comes along that is on par with the best you've seen, you take that.

i guess a 3x3 grid is not necessary, maybe when you click "another", push the old one up (or down) the stack but keep it around so I can always go back and pick the best one I liked so far after the sampling?

Anyway, don't sweat about it, thanks for creating this.

navane
0 replies
21h31m

What you are looking for is called the secretary problem [0]. This states that in a search like yours, you can determine beforehand how often you are willing to press "another", and after 37% of attempts, you pick the first one that's better than the best one so far.

[0] https://en.m.wikipedia.org/wiki/Secretary_problem

sccxy
3 replies
1d1h

Perfect

Replace intranet/Jira avatars with these on April 1st.

layer8
2 replies
22h1m

Why only on April 1st?

Rehanzo
1 replies
15h31m

April Fools day

layer8
0 replies
6h58m

Ok, let me rephrase: Why only on April Fools day?

gus_massa
3 replies
1d5h

Is it possible to have a gravatar-like interface, where I get a fixed image?

enahs-sf
0 replies
1d

burgeoning startup opportunity right here

ants_everywhere
3 replies
1d1h

Uh, are they all brown?

EDIT: oops, my fault, dark reader was changing the colors.

h4x0rr
2 replies
1d1h

You have dark reader on?

squigz
0 replies
1d1h

Hah. I do, and it definitely caught me off guard too. Thanks for pointing that out!

ants_everywhere
0 replies
1d

oh yeah I do, thanks! I'm not sure why I didn't think of that.

layer8
2 replies
22h8m

I love this. Should be hosted on thisavataristoouglytoexist.com though.

txstc55
1 replies
22h2m

Are they too ugly to exist though?

layer8
0 replies
21h57m

I was going to suggest thisavatardoesnotexist.com first, but it felt too counterfactual, so I settled on that.

ihaveajob
1 replies
23h46m

Ha! This is basically why I bought uglyavatar.com a couple of years ago. I was taken aback when I saw this on HN. Maybe I should do something with it one day...

doublerabbit
0 replies
23h27m

Just url redirect it to this repo page, if your not doing anything with it.

Might as well point it somewhere.

amadeuspagel
1 replies
23h1m

That's cool. Hacks into our ability to recognize faces, without requiring real faces. A forum, where these avatars are randomly generated per thread would be cool. Kind of like /pol/ thread ids, but easier recognize.

harrisi
0 replies
22h14m

Pareidolia, or, more generally, apophenia.

whc747914260
0 replies
39m

一个带着眼镜的帅气男孩

whc747914260
0 replies
39m

一个帅气的男孩,带着眼镜

tractor08
0 replies
4h59m

tractor

poyu
0 replies
1d1h

This is the generative art I love!

oseph
0 replies
1d1h

Ah this is awesome! I really like how you handled the hair in these.

I made something similar a few years back, pulling from a suite of random textures. https://holinaty.com/randomfaces/

kevin_am
0 replies
12h20m

Great, and I think I've seen something similar like this style.

imzadi
0 replies
1d1h

I feel called out