crop

Problem in cropping the UIImage using CGContext?

孤者浪人 提交于 2019-12-19 03:58:07
问题 I developing the simple UIApplication in which i want to crop the UIImage (in .jpg format) with help of CGContext. The developed code till now as follows, CGImageRef graphicOriginalImage = [originalImage.image CGImage]; UIGraphicsBeginImageContext(originalImage.image.size); CGContextRef ctx = UIGraphicsGetCurrentContext(); CGBitmapContextCreateImage(graphicOriginalImage); CGFloat fltW = originalImage.image.size.width; CGFloat fltH = originalImage.image.size.height; CGFloat X = round(fltW/4);

Rotate and crop

狂风中的少年 提交于 2019-12-18 13:38:09
问题 I'm rotating and cropping a image with PHP, but I get the black border showing, I know you can change the background color, but I want to rotate and crop the image to fill the whole image. Basically something similar to background-size: cover; (left) in CSS versus background-size: contain; (right). See the image below, at right is what I got now, left is what I want to achieve. The number of degrees to rotate is dynamic and the image to be produced and the source-image are both square

ImageMagick: how to minimally crop an image to a certain aspect ratio?

痞子三分冷 提交于 2019-12-18 11:44:45
问题 With imagemagick, I'd like to crop an image, in a minimal fashion, so that it fits a given aspect ratio. Example: given an image of, say, 3038 x 2014 px, I want to crop it to have a 3:2 aspect ratio. The resulting image would then be 3021 x 2014 px, cropped from the, say, center of the original image. So looking for a command looking something like convert in.jpg -gravity center -crop_to_aspect_ratio 3:2 out.jpg . 回答1: 1. Specific target resolution If your goal at the end is to have a certain

Cropping UIImage like camscanner

只谈情不闲聊 提交于 2019-12-18 10:45:00
问题 I am stuck in my application feature. I want cropping feature similar to Cam Scanner Cropping. The screens of CAM-SCANNER are: I have created similar crop view. I have obtained CGPoint of four corners. But How can I obtained cropped image in slant. Please provide me some suggestions if possible. 回答1: This is a perspective transform problem. In this case they are plotting a 3D projection in a 2D plane. As, the first image has selection corners in quadrilateral shape and when you transform it

Cropping CIImage with CICrop isn't working properly

邮差的信 提交于 2019-12-18 10:36:22
问题 I'm having troubles cropping image. For me CICrop filter is not working properly. If my CIVector x and y (origins) are 0 everything working fine (image is cropped from left bottom corner), image is cropped by my rectangle width and height, but if CIVector origins (x and y) aren't 0 in my cropped image becomes space (because CICrop filter cropping from bottom left corner no matter what origins (x and y) are). I'm cropping CIImage with rectangle, source : CIVector *cropRect =[CIVector

Crop Image as circle in Android

╄→гoц情女王★ 提交于 2019-12-18 04:13:31
问题 Does anyone know how to crop an image\bitmap to a circle? I can not find any solution, sorry .. 回答1: For having rounded corners for ImageView, convert your image into bitmap and then try following code : private Bitmap getRoundedCroppedBitmap(Bitmap bitmap) { int widthLight = bitmap.getWidth(); int heightLight = bitmap.getHeight(); Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(),Config.ARGB_8888); Canvas canvas = new Canvas(output); Paint paintColor = new Paint();

Cropping a PDF / Adding crop box using Ghostscript

大憨熊 提交于 2019-12-18 03:37:08
问题 I have a few hundred PDFs that I need to crop - I'm willing to either crop the actual documents or simply add a crop box to each so the correct viewable area shows when the PDF is opened. How can I do this using Ghostscript (v8.71)? I found this: gs -sDEVICE=pdfwrite -sOutputFile=marked.pdf [/CropBox [54 54 1314 810] /PAGES pdfmark original.pdf I've tried this (and all variants I can think of) but I always get an error such as this: Error: /undefinedfilename in ([/CropBox) I've tried moving

JQuery JCrop - How to set a fixed size selection area?

空扰寡人 提交于 2019-12-17 21:48:15
问题 I'm trying to figure out how to fix the selection box size under JCrop. The documentation mentions how to set an initial selection area but not how to make it fixed size. Does anybody knows how could I make it fixed. Thanks in advance. http://deepliquid.com/content/Jcrop_Manual.html 回答1: You are basically looking for the API section. Having extensively used this plugin myself, I know exactly what you're looking for: var api; var cropWidth = 100; var cropHeight = 100; $(window).load(function()

MATLAB: how do I crop out a circle from an image

血红的双手。 提交于 2019-12-17 19:44:03
问题 I need to crop a circle in MATLAB. I need to perform iris segmentation, and I´ve identified the center point and the radius of the iris, and I need to cut it off from the image. I have a vector ci that ci(1) is X-coordinate ci(2) is Y-coordinate and ci(3) is the radius of the circle. 回答1: One way to do this is to create a binary mask with ones inside the circle and zeros outside. You can then use this array to either mask everything outside the circle with NaNs, or to read the pixel values of

Image Cropping using Python

非 Y 不嫁゛ 提交于 2019-12-17 18:16:04
问题 I am new to Python coding and I am writing a program in which I will be cropping an entered image and then saving it in a location. Now, I am being able to do this using a combination of PIL and pygame. But the problem is that, when I am selecting the image from the open pygame window, the selection area is totally opaque and I am not able to see through the region I am selecting. This is causing problems for my boss who wants to be able to see through it as he selects. For you guys to better