crop

iPhone - CGImageCreateWithImageInRect rotating some camera roll pictures

一曲冷凌霜 提交于 2019-11-29 04:40:16
问题 I am working on a pixelate application for iPhone. Because the pictures taken with the iPhone 4 camera are too big and therefore the application is working really slow when updating the pixelated picture, I am trying to create tiles of the picture first and just update the tiles not the hole picture. When building the tiles, it works for camera roll picture taken in landscape mode (2592 x 1936 pxl) and with low resolution pictures, but not with picture taken in portrait mode (1936 x 2592 pxl)

Crop Image as circle in Android

萝らか妹 提交于 2019-11-29 04:32:42
Does anyone know how to crop an image\bitmap to a circle? I can not find any solution, sorry .. 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(); paintColor.setFlags(Paint.ANTI_ALIAS_FLAG); RectF rectF = new RectF(new Rect(0, 0, widthLight, heightLight));

Swift: Crop and Export Video

本秂侑毒 提交于 2019-11-29 04:12:49
I want to crop a video to square, but i couldn't do that. I converted this code to swift but i only get black screen after exporting the video var videoComposition: AVMutableVideoComposition = AVMutableVideoComposition() videoComposition.frameDuration = CMTimeMake(1, 60) videoComposition.renderSize = CGSizeMake(clipVideoTrack.naturalSize.height, clipVideoTrack.naturalSize.height) var instruction: AVMutableVideoCompositionInstruction = AVMutableVideoCompositionInstruction() instruction.timeRange = CMTimeRangeMake(kCMTimeZero, CMTimeMakeWithSeconds(60, 30)) var transformer:

Cropping Image in Android (Crop Intent)

和自甴很熟 提交于 2019-11-29 03:56:52
问题 I used this code to use android's built in image crop tools. My code is the following public void takePicture(){ Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); if (takePictureIntent.resolveActivity(getPackageManager()) != null){ takePictureIntent.putExtra(MediaStore.EXTRA_OUTPUT, MediaStore.Images.Media.EXTERNAL_CONTENT_URI.toString()); takePictureIntent.putExtra("crop", "true"); takePictureIntent.putExtra("aspectX", 0); takePictureIntent.putExtra("aspectY", 0);

Cropping a PDF / Adding crop box using Ghostscript

↘锁芯ラ 提交于 2019-11-29 02:17:22
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 around the parameters of the command but nothing seems to work. Does anyone know how this can be

Crop/trim a JPG file with empty space with Java

独自空忆成欢 提交于 2019-11-29 02:05:33
Is there a framework which is able to remove the white space (rectangular) of an image. We create Image Thumbnails from technical drawings which are unfortunately in PDF format. We convert the PDF to SVG and then to JPG. Often the technical drawings are very small and now placed in the upper left corner of the thumbnail: +---------+----------------------+ | | | | (image) | | | | | +---------+ | | | | | | | | | | (empty space) | | | | | +--------------------------------+ So how can I easily remove the empty space and shrink the JPG file? It can be done in JAI as is demonstrated in this thread .

How to crop images from camera

感情迁移 提交于 2019-11-29 00:11:26
How can I crop the camera images. Now it is showing the the image for crop and after selecting the crop section while tap on the " Save " button. Its showing as " saving image ". After that nothing is happen. Here is my code. Button click : Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(MediaStore.EXTRA_OUTPUT, MediaStore.Images.Media.EXTERNAL_CONTENT_URI.toString()); intent.putExtra("crop", "true"); intent.putExtra("aspectX", 0); intent.putExtra("aspectY", 0); intent.putExtra("outputX", 200); intent.putExtra("outputY", 150); intent.putExtra("return-data", true);

Copy and crop images in Javascript

依然范特西╮ 提交于 2019-11-28 21:54:09
I'm trying to create a small 2D game in Javascript/Canvas which consists of several animated sprites. I'd like to cut down on the number of HTTP requests, so I combined each frame of animation (32px by 32px) into one image per sprite (say, 192px by 128px). Is there any way I can copy and crop these images clientside back into several smaller images? It would vastly simplify my rendering code and help reduce loading time due to network latency. Have a look at Pixastic , specifically http://www.pixastic.com/lib/docs/actions/crop . The HTML5 Canvas API provides a method called drawImage which

how do i use imagick in php? (resize & crop)

时光怂恿深爱的人放手 提交于 2019-11-28 21:26:16
问题 I use imagick for thumbnail crop, but sometimes cropped thumbnails are missing top part of the images (hair, eyes). I was thinking to resize the image then crop it. Also, I need to keep the image size ratio. Below is the php script I use for crop: $im = new imagick( "img/20130815233205-8.jpg" ); $im->cropThumbnailImage( 80, 80 ); $im->writeImage( "thumb/th_80x80_test.jpg" ); echo '<img src="thumb/th_80x80_test.jpg">'; Thanks.. 回答1: This task is not easy as the "important" part may not always

How to Locate Alignment Marks in an Image

↘锁芯ラ 提交于 2019-11-28 20:48:08
I am designing a system that will scan in standardized forms to images (e.g., TBitmap). I would like to identify alignment marks on these pages and use the locations of these crop marks to rotate the page to its proper orientation (so top is actually up) and to crop the image to the location of the alignment marks. An example image of a typical mark I'd need to locate is: (source: tpub.com ) What are techniques to evaluate an image obtained from a scanner to locate various marks within the image? I'd need to locate multiple marks and their center point locations. Just brainstorming some