You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 1, 2020. It is now read-only.
Would be great if blinkdiff supported image cropping so that for example a small image could be compared with a cropped region of a larger image like a screenshot.
/** * Crops the source image to the bounds of rect * * @private * @method _crop * @param {PNGImage} image Source image * @param {object} rect Values for rect * @param (int} rect.left Left value of rect * @param (int} rect.top Top value of rect * @param (int} rect.width Width value of rect * @param (int} rect.height Height value of rect */_crop: function(image,rect){if((rect.left+rect.width)<=image.getWidth()&&(rect.top+rect.height)<=image.getHeight()){this.log("Cropping from "+rect.left+","+rect.top+" by "+rect.width+" x "+rect.height);image.clip(rect.left,rect.top,rect.width,rect.height);}},
The text was updated successfully, but these errors were encountered:
I just pushed the cropping feature. Now, you can crop each of the images by supplying a crop-object. The properties of these objects are:
x - X coordinate (Left)
y - Y coordinate (Top)
width - Width of image
height - Height of image
Note that the x and y coordinates are different to your suggested left and top property names.
You can also leave some of the values off. Then, they will be calculated according to some rules.
Thank you again for these great suggestions. I really appreciate it.
I still work on two more features, and I will publish the code then to NPM. I will keep you posted.
Would be great if blinkdiff supported image cropping so that for example a small image could be compared with a cropped region of a larger image like a screenshot.
Something like:
The text was updated successfully, but these errors were encountered: