smartcrop.js icon indicating copy to clipboard operation
smartcrop.js copied to clipboard

is it possible to input raw data & get raw data as output?

Open chr4ss12 opened this issue 3 years ago • 1 comments
trafficstars

I was wondering if this library supports a case of:

I want to input containerWidth, containerHeight, as well imageWidth, imageHeight, and imageFacesOnScreen, and I would like to get back:

imageScale, imageX, imageY (basically these 3 parameters help me to scale/reposition the image in the container) thus giving me the best "crop", in essence I am not sure how to create this algorithm, but I dont need any face detection algorithms as I already have them, and I dont need any bitmap manipulation as its all handled. I would essentially need "description" of how to position the face in a container the best way.

chr4ss12 avatar Aug 19 '22 15:08 chr4ss12

Smartcrop always works with image data as input. You could feed it a 'blank' image and supply the faces in the boost parameter (as it's done in smartcrop-cli). But at that point smartcrop is just a fairly inefficient way of fitting a rectangle to a bunch of rectangles. As for the output, the format is different but you do get back rectangles, smartcrop doesn't perform image manipulation.

jwagner avatar Aug 19 '22 16:08 jwagner