-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathresemble.js.node.txt
52 lines (45 loc) · 3.26 KB
/
resemble.js.node.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
┏━━━━━━━━━━━━━━━━━┓
┃ RESEMBLE.JS ┃
┗━━━━━━━━━━━━━━━━━┛
VERSION ==> #2.2.0
#Compare two images and outputs a PNG with superposition of images and highlighted differences.
#Can also give general RGB information about a single picture.
RESEMBLE('URL'|IMG|BLOB)->RES #All functions return RESS
RESS.compareTo('URL'|IMG|BLOB) #Second image to compare with
RESS.onComplete(FUNC(OBJ)) #Must be last in the chain. Gets the final output.
#OBJ (when compareTo() was called):
# - getImageDataUrl([STR])->'PNG_DATA_URI':
# - final output
# - STR is title
# - misMatchPercentage FLOAT (0-100)
# - diffBounds:
# - top|right|left|bottom NUM
# - smaller rectangle containing all differences
# - isSameDimensions BOOL
# - dimensionDifference: width|height NUM
# - analysisTime NUM (in ms)
# - error ERROR
#OBJ (when compareTo() was not called):
# - red|green|blue 0-255
# - brightness 0-255
RESS.repaint() #Redo comparison
#To do if settings changed
RESEMBLE.outputSettings(OBJ) #OBJ:
# - transparency FLOAT (0-1): of the original picture in the final output
# - errorColor:
# - red|green|blue 0-255 (def: purple)
# - color used to show differences
# - errorType 'flat|movement[DifferenceIntensity]':
# - how difference is being reported
# - 'flat' gives same color for any amount of difference, 'movement' is proportional
# - 'DifferenceIntensity' add brightness instead of superposing
# - largeImageThreshold NUM (def: 1200):
# - if comparison has height|weigth > NUMpx, do not analyze all pixels
# - only if ignoreAntialiasing() was called
MODES ==> #The next three are exclusive
RESS.ignoreNothing() #Default
RESS.ignoreColors() #Do not take into account hue-mostly differences
RESS.ignoreAntialiasing() #Do not take into account antialiasing-based border differences
RESS.scaleToSameSize| #Scale second image to first one:
useOriginalSize() # - scaleToSameSize: on original IMG
# - useOriginalSize (def): on final CANVAS