[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology

Name
Options
Comment
Verification
4chan Pass users can bypass this verification. [Learn More] [Login]
File
  • Please read the Rules and FAQ before posting.
  • You may highlight syntax and preserve whitespace by using [code] tags.

08/21/20New boards added: /vrpg/, /vmg/, /vst/ and /vm/
05/04/17New trial board added: /bant/ - International/Random
10/04/16New board for 4chan Pass users: /vip/ - Very Important Posts
[Hide] [Show All]


Janitor applications are now open. Apply here!


[Advertise on 4chan]


File: 1778021226970593.png (32 KB, 717x559)
32 KB PNG
I can't remember what half of my Python scripts do or why I have them saved. Here's checksum-changer.py and I guess it is to shitpost banned 4chan images.
#!/usr/bin/env python3

import cv2

import os
import random
import sys
import time

if __name__ == "__main__":
if len(sys.argv) < 2:
print("Usage: {} image (n)".format(sys.argv[0]))
sys.exit(1)
fn = sys.argv[1]

n = 1
if len(sys.argv) > 2:
n = int(sys.argv[2])

dir = os.path.split(fn)[0]
ext = os.path.splitext(fn)[-1]
im_orig = cv2.imread(fn, cv2.IMREAD_UNCHANGED)
for i in range(n):
im = im_orig.copy()
x = random.randint(0, im.shape[1]-1)
y = random.randint(0, im.shape[0]-1)
im[y, x] += 1

name = f"{int(time.time()*1000+i)}{ext}"
cv2.imwrite(os.path.join(dir, name), im)
>>
>>108982721
the heck is this? just
convert image.png image.png

you need imagemagick which you should already have
>>
File: 1775582483796373.png (2.36 MB, 1280x1674)
2.36 MB PNG
>>108982731
Yeah but can it create 100 different images with different checksums?
>>
>>108982745
why do you need that? you re-encode it again when it gets banned again
>>
>>108982759
I don't know.
>>
>>108982721
Just ask your AI gf to keep track of them
>>
File: file.png (17 KB, 499x139)
17 KB PNG
>>108982721
here's my checksum changer sis
>>
File: 1767309494775806.png (632 KB, 1042x753)
632 KB PNG
>>108982803
>>
>>108982803
based
>>
>>108982721
>needs python script to change 1 byte in a file
If all your scripts are this retarded just rm -f



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.