Answer the question
In order to leave comments, you need to log in
How does this png filter sub work?
image file png 3x3 with all different colors
encoded in idat block 3 scan lines 1st line has filter 1 (sub)
colors encoded in png through photoshop rgb (0,162,232) (185,122,87) (34,177,76)
here is a description of the filter
code
def Raw(i,d):
if i < 0:
return 0
else:
return d[i]
def unsub(d):
dd = b""
for i,b in enumerate(d):
bpp = 4
dd += bytes([b + Raw(i - bpp,d)])
return dd
dd += bytes([b + Raw(i - bpp,d)])
ValueError: bytes must be in range(0, 256)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question