Using clip having demarcated areas only (output from MaskMaker, Emarker, Morpher or any other method)as a mask, a bounded area in which specified point lies is colored in the input clip by area fill algorithm.
Points in different areas with same or different colors may be specified in a single call, as parameter 5, is an array of x coordinate, y coordinate and color.
To facilitate coloring of moving objects, movex and movey can be specified. Proportionate values of these are added per frame (in the frame range) to the drop point coordinates. Further if pshow is true (used for test purposes), the drop point is shown in pcolor on the output. This is useful in optimizing the coordinates while using movex or movey.
Normally the grey scale (or luma y) values of the image is unaltered. If grey scale value of image remains same as in original, some color changes may not be possible e.g.: black to white. Shifting by a value or stretching by a %age of grey is possible to enable such changes.
The color value can be specified in RRGGBB format or as xxyyuuvv format if its value has one higher bit set
RGB32, RGB24, YUY2 and YV12 formats only are supported
In the example given below the maskmaker was initially used in test mode to zero in the amplitude levels which result in required coloring of areas.
Description | Name | Type | Limits | Default |
Input clip to be colored | clip | none | ||
mask clip | clip | none | ||
Starting frame number to process | integer | within clip | none | |
End frame number to process | integer | within clip and not less than sf | none | |
Following 3 values form a set of 3 and several such sets can be specified | ||||
Drop x coordinate start frame | integer | within frame | none | |
Drop y coordinate at start frame | integer | within clip | none | |
Color of drop | integer | RRGGBB or XXYYUUVV | none | |
Increase in x to reach end frame | movex | integer | within frame | 0 |
Increase in Y to reach end frame | movey | integer | within frame | 0 |
Shift grey values or stretch? | shift | boolean | true for shift, false for stretch | true |
value of shift or stretch % | st | integer | -255 to 255 for shift, -100 to reasonable for stretch | 0 |
Drop point to be shown? | pshow | boolean | true for show or false to not to show | false |
Color to use for drop point | pcol | integer | $RRGGBB format | 0 |
Usage examples:-
#test mode and only one drop per frame, coordinates varying linearly with frames 1 to 8 cd=colordrops(last,mask1,1,8,60,370,$ff,160,10,$ff, movex=-40, movey=70, pshow=true, pcolor=0) # several drops per frame in frame range 1 to 8. note second color is in yyuuvv format colordrops(last,mask1,1,8,60,370,$ff34,360,10,$17010f0,460,220,$9010f0) #following script used to color portions of a canyon . im = input image clip is here grey = greyscale(im)# used as input blur = gaussblur(grey, size = 7) #maskmaker in test mode was used to arrive at gyt and et values #msk = maskmaker(blur,0,19,"c1",gyt=20,et=250, test=true, ft=100,fet=250) msk = maskmaker(blur,0,19,"c1",gyt=92,et=250) #return(msk.grid()) cd = colordrops( grey, msk,0,19,450,180,$2f0f07,350,150,$2f0f07,300,170,$2f0f07,100,130,$2f0f07,150,250,$2f0f07) stackhorizontal(msk. grid(), cd)
To Colorit Synopsis | |||
To my index page | |||
down load plugin | |||
To Avisynth |