js 图像裁剪_使用smartcrop.js进行重点图像裁剪

痛定思痛。 2023-02-22 03:38 90阅读 0赞

js 图像裁剪

Images tend to make any page more engaging, especially when done right. The problem is that automating image creation and sizing can be a very difficult task, especially when the image is uploaded by a user — who knows what format, size, and resolution the image will be. Hell, who knows if they’re actually sending you an image for that matter (though validating that they’ve uploaded an image isn’t too difficult).

图片往往会使任何页面更具吸引力,尤其是正确处理时。 问题在于,自动创建图像并调整其大小可能是一项非常困难的任务,尤其是当图像由用户上传时,该用户知道图像的格式,大小和分辨率。 地狱,谁知道他们是否真的向您发送了图片(尽管验证他们是否已上传图片并不太困难)。

I recently found out about smartcrop.js, a brilliant JavaScript utility which analyzes the contents of an image and finds the focal point (a face, for example) of any image. It’s easy to use and does an outstanding job picking up on the important part of an image.

我最近发现了smartcrop.js ,这是一个出色JavaScript实用程序,可以分析图像的内容并找到任何图像的焦点(例如,人脸)。 它易于使用,并且在处理图像的重要部分方面做得非常出色。

Check out a few images I put through the smartcrop.js testbed:

看看我通过smartcrop.js测试床放置的一些图像:

format_png

format_png 1

format_png 2

format_png 3

I wont bother showing the super simple code sample — you can view that on the smartcrop.js repo. And be sure to play around on the testbed. I love recognizing developers for their feats and this is some incredible work by Jonas Wagner!

我不会花时间显示超级简单的代码示例-您可以在smartcrop.js存储库中查看它。 并确保在测试平台上玩耍。 我喜欢承认开发人员的壮举,这是乔纳斯·瓦格纳(Jonas Wagner)所做的令人难以置信的工作!

翻译自: https://davidwalsh.name/smart-crop

js 图像裁剪

发表评论

表情:
评论列表 (有 0 条评论,90人围观)

还没有评论,来说两句吧...

相关阅读

    相关 Arcgis中图像裁剪

    使用arcmap对数据进行剪裁,[Arcgis][]中的裁剪分为很多种,有矢量裁剪矢量,矢量裁剪栅格,栅格裁剪栅格。本文主要操作,掩膜裁剪(矢量裁剪栅格)和clip 裁剪。

    相关 python裁剪图像

    之前以为python裁剪图像很难,后来才发现知道裁剪坐标以后(坐标根据目标检测进行坐标变换吧),就很简单了。 1.裁剪 import cv2 cut =

    相关 C#实现图像的鼠标裁剪

    C\的图像裁剪很容易操作,这里给个实现的例子 关键是需要处理鼠标的事件和一些更新 实现鼠标移动的代码.注意更新不要全部重画,只有选择矩形部分重画     C\的图像裁

    相关 eps格式图像空白边缘裁剪

    经常使用matlab制作各种曲线图,为了在latex中使用且避免失真,一般可保存为eps格式,但是有时由于原来的图像可能有较大的空白边缘,在文章中显示效果不佳,可以将图片裁剪去