Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Bloody
Mar 3, 2013

Jonny 290 posted:

make a cryptocurrency based on yosposts

like you have to mine by Posting

Adbot
ADBOT LOVES YOU

NoneMoreNegative
Jul 20, 2000
GOTH FASCISTIC
PAIN
MASTER




shit wizard dad

POSTCOINT++

hbag
Feb 13, 2021

i think for now ill stick to lovely forum badges

hbag
Feb 13, 2021

well anyway now im trying to figure out if there's a way to test if an image is entirely transparent
as in, test if the image is nothing BUT transparent pixels, no color whatsoever

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

hbag posted:

well anyway now im trying to figure out if there's a way to test if an image is entirely transparent
as in, test if the image is nothing BUT transparent pixels, no color whatsoever

if you dig in to the png spec youll find this shouldnt really be that hard. start here: https://www.w3.org/TR/PNG/#11transinfo

hbag
Feb 13, 2021

fart simpson posted:

if you dig in to the png spec youll find this shouldnt really be that hard. start here: https://www.w3.org/TR/PNG/#11transinfo

nice, ill give this a read

hbag
Feb 13, 2021

welp after reading this im not sure if theres an alpha channel for the ENTIRE image's transparency or if there's only alpha channels for individual pixels

Broken Machine
Oct 22, 2010

hbag posted:

welp after reading this im not sure if theres an alpha channel for the ENTIRE image's transparency or if there's only alpha channels for individual pixels

couldn't you just check every pixel then?

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

hbag posted:

welp after reading this im not sure if theres an alpha channel for the ENTIRE image's transparency or if there's only alpha channels for individual pixels

realistically your image library probably can do this for you. without having used it before i'd probably try this method and see if the max value for the alpha band is 0, assuming there is an alpha band

https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.getextrema

idk if that will actually work but read the docs imo

AnimeIsTrash
Jun 30, 2018

Should create an app that shows how much a user has spent on AV changes.

hbag
Feb 13, 2021

Broken Machine posted:

couldn't you just check every pixel then?

i dont think checking the transparency of a pixel at most 32,400 times is very efficient


fart simpson posted:

realistically your image library probably can do this for you. without having used it before i'd probably try this method and see if the max value for the alpha band is 0, assuming there is an alpha band

https://pillow.readthedocs.io/en/stable/reference/Image.html#PIL.Image.Image.getextrema

idk if that will actually work but read the docs imo

ill give it a try

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

hbag posted:

i dont think checking the transparency of a pixel at most 32,400 times is very efficient
ill give it a try

32,400 is not a big number for a computer though

Sagebrush
Feb 26, 2012

hbag posted:

i dont think checking the transparency of a pixel at most 32,400 times is very efficient
ill give it a try

your computer has 2 to 8 processing units capable of comparing a number to another number around 3 billion times per second.

if you count the gpu it's more like 2000 processing units

Armitag3
Mar 15, 2020

Forget it Jake, it's cybertown.


Sagebrush posted:

your computer has 2 to 8 processing units capable of comparing a number to another number around 3 billion times per second.

if you count the gpu it's more like 2000 processing units

Yeah? Then why is my poasting so bad buddy? you tell me that

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:



whatever server that repl.it feels like letting me use for free was able to compare 32,400 integers to 0 in under 7 milliseconds

hbag
Feb 13, 2021

Sagebrush posted:

your computer has 2 to 8 processing units capable of comparing a number to another number around 3 billion times per second.

if you count the gpu it's more like 2000 processing units

actually i have a ryzen 5 2600 so it actually has 12 logical processors :smug:

Sagebrush
Feb 26, 2012

i have a ryzen with 24 logical processors.

faxlore
Sep 24, 2014

a blue star tattoo for you!

fart simpson posted:



whatever server that repl.it feels like letting me use for free was able to compare 32,400 integers to 0 in under 7 milliseconds

also there’s a short circuit scenario where if you hit a certain percentage of transparent pixels, let’s say 10%, you can kill the loop and have a pretty good guess it’s an image with some sort of transparency and not have to process the whole image.

but also some image libraries might already have a method to do this but it might be a fun exercise to implement your own method and compare for ~*~learning~*~

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Sagebrush posted:

i have a ryzen with 24 logical processors.

sounds like you could handle a whole megapixel sized image with that bad boy

faxlore
Sep 24, 2014

a blue star tattoo for you!

fart simpson posted:

sounds like you could handle a whole megapixel sized image with that bad boy

*slaps top of desktop causing all the rgb lights to flicker* heh, yeah this thing can just poo poo out prime numbers, ol’ reliable I call it

hbag
Feb 13, 2021

anyway now im trying to figure out how to grab someone's avatar from their profile
starting with this and seeing what errors it gives me

pre:
		avatar = (userProfile.select_one('.userinfo .title')).find('img')
		print(str(avatar))

hbag
Feb 13, 2021

in a shocking turn of events it actually worked first time
hoiy poo poo

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

hbag posted:

in a shocking turn of events it actually worked first time
hoiy poo poo

pro tip: if you use a statically typed compiled language you’ll encounter this more often imo

Captain Foo
May 11, 2004

we vibin'
we slidin'
we breathin'
we dyin'

fart simpson posted:

a toribot that interrupts ongoing discussions about x by posting “x is from pittsburgh”

bot accounts aren’t alowed to post outside dedicated containment threads, as of the last time a toribot was written

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

hbag posted:

i dont think checking the transparency of a pixel at most 32,400 times is very efficient
ill give it a try

you will indeed have to check every pixel. It is possible for an image to have a single opaque pixel and every other pixel transparent.

also python image tools loving SUCK.

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
or they did five or six years ago when i was fuckin around with them. They punt everything to imagamagick which is great for quick resizing and poo poo but if you want to actually do pixel by pixel ops on an image it was UGH with a capital UGH

Eeyo
Aug 29, 2004

i’ve got terminal scientist brain so obviously the answer is figuring out how people cast images into numpy arrays. presumably some library must do that easily so people can feed their dog images into their neural nets or whatever.

with numpy arrays checking the value of all the pixels is quick since you don’t have to actually do it in native python, and it can be automatically done in parallel. but then you’re adding another library so :shrug:

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
i think like checking each pixel for alpha channel is probably fine but if you're trying to do someting even mildly sophisticated like convolution is a massive pain in the rear end

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
if you like doing image stuff, the JAI is very robust https://www.oracle.com/java/technologies/advanced-imaging-api.html

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
but i guess its on a fasttrack to EOL so idk

I assume there's other good imaging libraries but that was the one i used and really liked.

hbag
Feb 13, 2021

tbh what i wanna do is text if theyve got an invisible avatar with their actual av being gangtags beneath it (like i do) so i can display that instead of the blank 1 pixel tall thing they got

Smythe
Oct 12, 2003

hbag posted:

quick give me cool ideas for lovely web toys to make for the forums
i will work on them alongside my badges

update this: https://chrome.google.com/webstore/detail/sa-needful/bipfbhacdgoojjfblifgjadhabepbekm

Jonny 290
May 5, 2005



[ASK] me about OS/2 Warp
you could also update that greasemonkey or w/e script that completely memoryholed ignored posters instead of leaving the placeholder posts. that was nice.

Sagebrush
Feb 26, 2012

it was a couple of ublock filters i wrote but honestly i haven't needed them since stymie and the gang got banned.

one that blocks smoka youtube posts while leaving ones containing text would still be handy though.

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome

Jonny 290 posted:

you could also update that greasemonkey or w/e script that completely memoryholed ignored posters instead of leaving the placeholder posts. that was nice.

i should do an SA browser plugin

rotor
Jun 11, 2001

classic case of pineapple derangement syndrome
hbag, are you familiar with nntp

git apologist
Jun 4, 2003

rotor posted:

hbag, are you familiar with nntp

there it is

Kazinsal
Dec 13, 2011


rotor posted:

also python loving SUCKS.

hbag
Feb 13, 2021

rotor posted:

hbag, are you familiar with nntp

no but it sounds like some kind of designer drug that'll induce a ruptured aneurysm if you fall either side of its very slim margin of safe dosage

Adbot
ADBOT LOVES YOU

flakeloaf
Feb 26, 2003

Still better than android clock

so you have heard of it

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply