Tip #7
about command -resize
part A)
creating a pattern then applying -resize
#open gimp #create an image 30*30, black #select G'MIC -> various -> custom code (local) #remove what you find in #enter: (1,0,0;0,1,0;0,0,1^0,1,0;0,0,1;1,0,0^0,0,1;1,0,0;0,1,0) #this command creates a new image 3*3 with colours R G B ; B R G ; G B R -normalize 0,255 #for safety, as usual -resize[1] [0],3 #this is the command under examination #in this case: resize the newly created pattern to the base image dimensions #using linear interpolation -keep[1] #just to see only the newly created image #set output mode: new image #set OK
now, we will tests other resizing options, just replacing the command -resize -resize[1] [0],0,0 #we get the "canvas" (let me call it this way) resized #but the pattern is not rescaled, left 3*3 at the top-left corner #first 0 means no interpolation, second 0 means boundary black -resize[1] [0],0,1 #we get the "canvas" (let me call it this way) resized #but the pattern is not rescaled, left 3*3 at the top-left corner #first 0 means no interpolation, second parameter=1 means #boundary extended with the colours of the last pixel (we see a lot #of red because the bottom right pixel is red) -resize[1] [0],0,2 #we get the "canvas" (let me call it this way) resized #and filled completely by the pattern 3*3 #first 0 means no interpolation, second parameter=2 means #boundary extended with replications -resize[1] [0],1,0 #we get the 3*3 pattern rescaled 30*30 -resize[1] [0],2,0 #same as with 1 -resize[1] [0],3,0 #we get the 3*3 pattern rescaled 30*30 #and colours nicely interpolated -resize[1] [0],3,1 #same as above, with a different interpolation of the boundaries #you can put 5 or 6 in the previous 2 examples and you will get almost same results #as with 3; the difference is in the interpolation (linear, bicubic, lanczos) -resize[1] [0],4,0 #we get a black grid interpolating the 3*3 pattern #in this case, due to the big resizing (10 to 1), #the grid is big and occupies 9/10 of the image
part B)
applying -resize to an existing image
#open gimp #open your image #experiment with: --resize 300%,200%,1,3,0,2 #you get your image replicated six times (3*2) #or --resize 110%,110%,1,3,4,0 #you get a grid interpolated (10% only) #you may also apply again interpolation 4 on the already interpolated image -resize 150%,150%,1,3,4,0 #you get a nice kind of double grid #also try --resize 110%,110%,1,3,0,1 #you get a kind of frame with the boundary #extended (having added 0.5,0.5 the image is centred) #OK, now continue as you like (if you like...)
#I attach a folder with my tests. #all images have been saved with the name: pattern-resize-n(-m) or image-resize-n(-m) #where n is the interpolation type, m(shown if not zero) is the boundary type
#note: interpolation 3, 5, 6 (linear, bicubic, lanczos) #are the usual resizing interpolation types #found in almost all image processing software
_________________ "Where am I ?"
|