crop

Command line batch image cropping tool

混江龙づ霸主 提交于 2019-12-02 17:53:39
is there any lightweight command line batch image cropping tool(Linux or Windows) which can handle a variety of the formats ? Imagemagick is what you want -- tried and true. Ralph In Linux you can use mogrify -crop {Width}x{Height}+{X}+{Y} +repage image.png for CLI image manipulation Imagemagick's convert does the trick for me (and much more than cropping): convert -crop +100+10 in.jpg out.jpg crops 100 pixels off the left border, 10 pixels from the top. convert -crop -100+0 in.jpg out.jpg crops 100 pixels off the right, and so on. The Imagemagick website knows more: http://www.imagemagick.org

iPhone programmatically crop a square image to appear as circle

倾然丶 夕夏残阳落幕 提交于 2019-12-02 17:18:59
I'm trying to create an image for a custom style UIButton using an image from the camera roll on iPhone. The button has a circular background and effectively appears as a circle. Now I need an image to go in the middle of the button that also appears round. How do I cut a square UIImage to appear round with transparency outside of the round area? If masking is involved, do I need to pre-render a mask or can I create one programmatically(ex: a circle)? Thank you! Yes you can use CoreGraphics to draw the mask dynamically. Then you can create the masked image. Example for masking: - (UIImage*)

Able to capture UIImage as-is based on content mode from UIimageView?

天涯浪子 提交于 2019-12-02 16:44:55
问题 I was wondering if there is a way to capture an UIImage as it appears as-is viewed in an UIImageView based on its contentMode . For example, if I pass a 3:4 aspect ratio to a square UIImageView , and use "Aspect Fit" as the contentMode , then I'd expect to see white letterboxes in the left and right parts the image to fill out the square. Would it then be possible to take whatever appears and save it directly as an new UIImage with the letter boxing? Thanks! 回答1: You can capture a "screen

Django app for image crop using a cropping tool

假如想象 提交于 2019-12-02 16:26:13
I need an app for crop an image in the client side, I mean, using a cropping tool like Jcrop jquery plugin. I found this tools: django-image-cropper django-image-cropping django-imagehandler django-avatar-crop But the last two depends of admin and the two first seem very coupled to ther own ImageFields and models, any good solution? We are working over a big application with many features and is very difficult change the logic writed I think this is something that you will probably be best off writing yourself as it depends on how your data and models are layed out, whether (and where) you

Detect face then autocrop pictures

纵然是瞬间 提交于 2019-12-02 13:50:31
I am trying to find an app that can detect faces in my pictures, make the detected face centered and crop 720 x 720 pixels of the picture. It is rather very time consuming & meticulous to edit around hundreds of pictures I plan to do that. I have tried doing this using python opencv mentioned here but I think it is outdated. I've also tried using this but it's also giving me an error in my system. Also tried using face detection plugin for GIMP but it is designed for GIMP 2.6 but I am using 2.8 on a regular basis. I also tried doing what was posted at ultrahigh blog but it is very outdated

PHP fit any size image to 16:9 aspect ratio

好久不见. 提交于 2019-12-02 13:30:28
Good noon, I'm currently trying to understand how i can crop image already loaded on server with 16:9 aspect ratio. For better understandig, if I have 4:3 image i have to cut top and bottom image portions to fit it into 16:9 ratio. Thanks. I took this code example: http://myrusakov.ru/php-crop-image.html and changed the code according to my needs in this way: function crop_image($image) { //$x_o и $y_o - Output image top left angle coordinates on input image //$w_o и h_o - Width and height of output image list($w_i, $h_i, $type) = getimagesize($image); // Return the size and image type (number

How to crop circles (found with Hough Transform) in OpenCV?

一世执手 提交于 2019-12-02 12:56:12
问题 I'm using the code from the page. It works very well and I get a circle that I am looking for. All my image have only 1 circle and I have modified parameters of HoughCircles() such that the code returns only 1 circle. How can I crop my original image so that the new image has only the circle (and area within it) and save the new image as a JPEG or PNG file? Based upon original code, the center of the circle is given by (cvRound(circles[1][0]), cvRound(circles[1][1])); and the radius is given

crop image to 4:3 aspect ratio c#

僤鯓⒐⒋嵵緔 提交于 2019-12-02 11:48:21
问题 I'm having a tough time wrapping my head around how to figure out the math for cropping any image that has a higher aspect ratio than 4:3 to 4:3. For example, I may have some images that are 16:9 that I I want resized and then cropped to 4:3. The resize bit I already have working, but it's maintaining the same aspect ratio. I know I need to use Graphics.DrawImage() But I'm not entirely sure what the parameters should be nor how I derive those parameters. Here's what I do know: var dimension =

Nodejs image crop by coordinates

夙愿已清 提交于 2019-12-02 11:39:25
问题 Is there is way where we can give x, y coordinates while cropoing image. Currently what i am using is Imagemagick im.crop({ srcPath: upload_path+media_file_name, dstPath: upload_path+"thumb_"+media_file_name, width: 350, height: 210, quality: 1, gravity: 'Center' }, function(err, stdout, stderr){ }; This code is working but i haven't got luck with x , y coordinates. The following input i want to use for image cropping height:360 width:360 x:180 y:300 回答1: I don't speak node, but can you use

Crop image to smallest size by removing transparent pixels in java

廉价感情. 提交于 2019-12-02 11:31:53
问题 I have a sprite sheet which has each image centered in a 32x32 cell. The actual images are not 32x32, but slightly smaller. What I'd like to do is take a cell and crop the transparent pixels so the image is as small as it can be. How would I do that in Java (JDK 6)? Here is an example of how I'm currently breaking up the tile sheet into cells: BufferedImage tilesheet = ImageIO.read(getClass().getResourceAsStream("/sheet.png"); for (int i = 0; i < 15; i++) { Image img = tilesheet.getSubimage(i