FAQ Database Discussion Community


Quick and simple way to get min and max y for square within a rotated rectangle

javascript,image,rotation,crop,trigonometry
So I'm trying to get the top left x,y values for the green box to crop an image that has been rotated into a square. The green square can move left and right on the dotted line, so I'm able to get the x value, I'm just having a hard...

convert and crop image in tiles with python

python,imagemagick,crop,imagemagick-convert,wand
I tried to tile a JPG image in python. Usualy I use imageMagick .. so I have seen than wand seems to do this work ... But I am not able to translate convert -crop 256x256 +repage big_image.jpg tiles_%d.jpg someone ca help me ?...

Imagemagick crop loop not working well

bash,crop,imagemagick-convert
I need to cut 16 images out from one. All images in .tif format. Coordinates of top left points of each images contains in text file. It's like 100,200 300,400 ... I used this bash code IFS=',' while read x y; do convert image.tif -crop 262x262+$x+$y image_%02d.tif; done < coordinates...

Use BitmapFactory to load cropped image from stream/file

android,image,crop,bitmapfactory
Is there a simple way to use BitmapFactory.decodeFile() or BitmapFactory.decodeStream() to directly get a center cropped bitmap instead of first loading the complete bitmap and then apply bitmap transformations such as Bitmap cropped = Bitmap.createBitmap(...)? I guess when the encoding is known, it should be possible to only read relevant...

Why do my pasted images looked cropped in LibreOffice Writer?

image,crop,paste,libreoffice,writer
I'm writing an academic paper in Writer, and wherever I paste an image into it, the image will look cropped, like this (notice the top section): However, if I paste the same image in any other writer document, it will look just fine: I have to mention that I initially...

PHP fit any size image to 16:9 aspect ratio

php,resize,crop,ratio,aspect
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....

How can I capture multiple images out of one in the ?

javascript,html5,image,canvas,crop
I wrote some code that draws a semi-transparent rectangle over an image that you can draw with touch: function drawRect() { var canvas = document.getElementById('receipt'); var ctx = canvas.getContext('2d'); var drag = false; var imageObj; var rect = { }; var touch; canvas.width = WIDTH; canvas.height = HEIGHT; function init()...

Crop Text in a td CSS

html,css,html-table,crop
I'm active on a side called My Anime List. It's for tracking your Anime. On this site you can upload a custom CSS Design für your List I already achieved the design I want, but I want to improve it little by little so my first problem occurred. I want...

Calculate image cropping proportions

javascript,jquery,css,image,crop
I have some cropping feature on my site. So, the problem is that the real photo size is bigger that cropping area, and when i'm trying to get actual result of this cropping action i get proportions from visible - resized in css - area not from oryginal size of...

Remove specific class after this jquery plugin load

jquery,image,crop,resize-crop
I am trying to remove .lazy-hidden class from element(image). I have simple jquery plugin given below that can resize and crop the image to correct size by tweaking the image url. So it call re-sizing function after LazyloadXT loding of image. Problem is Image has loaded and croped, But unable...

Crop Bitmap using RectF parameters on Android

android,image,bitmap,zoom,crop
Using MikeOrtiz's awesome ImageView implementation with touch and zoom events, I wanted to crop a picture taken with the camera to match the zoom. Using his method... // Return a Rect representing the zoomed image. RectF getZoomedRect(); ...I tried cropping the resulting picture bitmap to the zoom size like so:...

Crop image with settable center and scale in Python PIL

python,image,zoom,python-imaging-library,crop
I would like to crop an image using PIL, although it could be some other module. I need the method to crop with a scale factor, ie 1.5 meaning that the output would be 1.5x zoomed in. Additionally, I would need to set the center where it zooms. This means...

Unity | 'gameobject.renderer.material.color' in version 5.x

unity3d,shader,crop,mask,renderer
I want to make a portion of the gameObject(guiTexture or sprite) as transparent color like "SpriteMask" which is in asset store. https://www.assetstore.unity3d.com/kr/#!/content/27642 Let me explain in more detail. For example, there are two gameObject in the scene. One is the background of the scene and the other one is just...

What does the return value of SurfaceTexture.getTransformMatrix mean, who can explain?

android,matrix,crop,surface
everyone: I am working with SurfaceTexture in Android but I am not able to understand Its API: getTransformMatrix(float[] mtx), the API doc is as follows: /** * Retrieve the 4x4 texture coordinate transform matrix associated with the texture image set by * the most recent call to updateTexImage. * *...

Camera crashes due to crop code one line, how to crop in standard way

android,camera,crop
My app crashes due to camera.putExtra("crop", "true"); Im assuming this is due to some stupid inconsistent vendor camera drivers or something... joys of fragmented market i guess. How can i crop if this doesn't work? preferably have crop square on screen to guide user. Is there a standard ~99% proof...

Is it possible to crop an Element using Elm's std library? If not, is there a 3rd party lib for this?

forms,scroll,element,crop,elm
I often run across a situation where I've constructed an Element or Form and wish to crop the view down to a given area (i.e. for scrolling within a smaller rectangle) though I haven't been able to find any methods for this within their respective modules. Is it possible to...

How to crop an image and set to imageVeiw

android,camera,crop
Im trying to crop an image taken from a camera and store it to an imageview - i m not sure how target my cropped image, it seems to be stored in gallery which im not bothered if it is or not. Problem: my crop method which works puts the...

Crop video before encoding with MediaCodec for Grafika's “Continuous Capture” Activity

android,video,opengl-es,crop,grafika
I am learning about Grafika's "Continuous Capture" Activity, It is about recording a video with MediaCodec, the video recording implementation is described in https://source.android.com/devices/graphics/architecture.html The activity source code is at https://github.com/google/grafika/blob/master/src/com/android/grafika/ContinuousCaptureActivity.java The program uses a SurfaceTexture obj to receive data from camera and creates 2 EGLSurface obj with this SurfaceTexture...

Bootstrap Thumbnail Cropping and Positioning

css,twitter-bootstrap,position,overflow,crop
I'm having these 3 images with different sizes. When I display them inside 3 containers like this: @foreach (var item in Model) { <div class="avatar-container"> <img class="avatar img-thumbnail" src="@Href("~/Content/Avatars/",item.Name+".jpg")" /> </div> } This is my CSS file: div.avatar-container { display: inline-block; max-height: 50px; overflow: hidden; width: 70px; } .avatar {...

Crop or resize images before upload to the server as raw image binary data (png or jpeg) [closed]

javascript,image,crop
I am trying to crop images in the browser and upload them to a server as raw image binary data (the format should be "image/jpeg" or "image/png"). I tried many client-side crop & upload methods, they all use the html 5 function canvas.toDataURL() to get the final cropped data in...

Qt QcomboBox: How to crop text, or how to get actual width of

c++,qt,crop,qmessagebox
I want to crop a text in a qcombobox. But for this, I need to know width of a qcombobox. And when I call something like this: ui->qcombobox->width() I get incorrect value(Actual width is about 260 px but the resulting width is always 100 px). Questions: How can I get...

How to crop boostrap image to get width 285 and height 170 of all images?

css,image,crop
I have difference size of images and I want it to have the same width and height and make it still responsive. So how to do this?

Nodejs image crop by coordinates

node.js,image,imagemagick,crop
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,...

Crop Image Located in Internal Storage

android,image,android-intent,crop,android-fileprovider
I am having trouble using the crop intent in Android. I am storing images in the internal storage allocation for my app and I want to be able to crop them and then set them as the wallpaper. I can get it to work with an image stored in external...

Problems Scrolling and Zooming an Image in an WP8.1 App

windows-runtime,windows-phone-8.1,crop,scrollviewer,fileopenpicker
I'm struggling with the ScrollViewer in my Windows Phone 8.1 (WinRT) app. Basically, what I'm trying to achieve is to retrieve an image using FileOpenPicker, crop the image to a fixed ratio (square) format while letting the user select the part of the image and the zoom level, and then...

Unable To Get UIImage to Match Custom ImagePickerController Preview

ios,objective-c,iphone,uiimage,crop
I am building an iOS app that is to have a full screen ImagePickerController, with the resulting image that is captured to be the same that is shown in the ImagePickerController View. This is my current relevant code: To create and transform the ImagePickerController: self.imagePicker = [[UIImagePickerController alloc] init]; self.imagePicker.delegate...

Android- Image resize and cropping

android,image,resize,crop
I am using a library to choose an image from the gallery and crop it. However, I found an option for rotating the image as well. Here's the link to the library I'm using. In my code I'm accessing the provided functionality similar to the example given in the library....

angularJS make binary data image from base64 and send as image file to server

javascript,jquery,angularjs,crop
I'm using this tool to crop images in my AngularJS app: https://github.com/fengyuanchen/cropper and then I try to store data to server, but now I send base64 code... How could I send normal cropped image binary code, not as base64? is it real? my code for uploading is such: var addImage...

How to crop a video to a circle in iOS?

ios,avfoundation,crop,video-processing
I am trying to crop an already taken video into a circle in iOS. How might I go about doing this. I know how I would do it with AVCaptureSession but I don't know to pass in an already taken video as an AVCaptureDevice? Is there a way to crop...

R: Crop GeoTiff Raster using packages “rgdal” and “raster”

r,crop,raster,rgdal,r-raster
I'd like to crop GeoTiff Raster Files using the two mentioned packages, "rgdal" and "raster". Everything works fine, except that the quality of the resulting output tif is very poor and in greyscale rather than colour. The original data are high quality raster maps from the swiss federal office of...

How to detect position of shape in image PHP [closed]

php,image,crop,imagick
I have image with white background and in that image i have some kind of shape - part of cloth. I need to find most left, up, right and bottom pixel. What is the most efficient way to do that?

Python PIL - AttributeError: 'NoneType' object has no attribute 'save'

python,border,python-imaging-library,crop,trim
I use this code to delete the border of an image using PIL: def RemoveBlackBorders(img): bg = Image.new(img.mode, img.size, img.getpixel((0,0))) diff = ImageChops.difference(img, bg) diff = ImageChops.add(diff, diff, 2.0, -100) bbox = diff.getbbox() if bbox: return img.crop(bbox) from here And I use this to process all images contained in a...

Creating a cropped image slideshow

javascript,jquery,css,image,crop
I am looking to create two side by side image galleries that can be controlled independently of eachother and allow for interesting image combinations. I have the cropped image code and the 'click to change image' code, i just cant figure out how to combine the two. Code: http://jsfiddle.net/7ae0chbs/ <!DOCTYPE...

SVG view box crop using jquery

javascript,jquery,image,svg,crop
I am doing sticker website for my client. They need image crop within given SVG image. That SVG image is unshaped like Halloween face (see below). When i upload an image, it will display within the given image. The rest of the image will hide. How can i achieve this?...

setImageResource from Filepath (Gallery?) com.edmodo.cropper

java,android,crop
Im using the Cropper (com.edmodo.cropper) to crop images. Can i crop an image from the gallery? How can i put the image from path to the CropImageView? its not working, can someone tell me another crop pack to crop images from path with the same features?...

Output Uri from this Android crop image library?

android,image,uri,crop
I'm trying to implement SoundCloud's image crop to my app. Here's what I'm doing so far: call Crop.pickImage((Activity) this) to pick an image @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); if (requestCode == Crop.REQUEST_PICK && resultCode == RESULT_OK) { Uri inputUri = data.getData(); new...

Android issue crop image on samsung s4

android,image,crop,samsung-mobile
I'm trying to get crop image working on Samsung s4 but it's not showing the crop screen. This is the code that I'm using. private void openCamera() { Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE); intent.putExtra(MediaStore.EXTRA_OUTPUT, MediaStore.Images.Media.EXTERNAL_CONTENT_URI.toString()); // ******** code for crop image intent.setType("image/*"); intent.putExtra("crop", "true"); intent.putExtra("aspectX", 3); intent.putExtra("aspectY", 4); intent.putExtra("outputX", 180);...

jQuery cropit export method return only 'data:,' string

jquery,html,crop
my html code for cropit: <div id="image-cropper" style="direction: ltr"> <div class="row margin-top-25"> <div class="col-md-8 col-md-offset-2"> <div class="cropit-image-preview-container"> <div class="cropit-image-preview"></div> </div> </div> </div> <div class="row margin-top-15"> <div class="col-md-4 col-md-offset-4"> <input type="range" class="cropit-image-zoom-input" /> </div> </div> <div class="row margin-top-15"> <div class="col-md-4...

Thumbnails with Face Detection in PHP

php,thumbnails,crop,face-detection
My objective with this script is to make smart thumbnails. In my demo package, I am using two scripts from different sources. To crop thumbnails (Source) - It totally works like native wordpress thumbnails Face Detection in PHP (Source) I am using the Face Detection to get the desired coordinates...

Crop does not work for gallery images

android,image,crop
I am using the following code to crop images from camera and gallery : private void doCrop() { final ArrayList<CropOption> cropOptions = new ArrayList<CropOption>(); Intent intent = new Intent("com.android.camera.action.CROP"); intent.setType("image/*"); List<ResolveInfo> list = getPackageManager().queryIntentActivities(intent, 0); int size = list.size(); if (size == 0) { Toast.makeText(this, getApplicationContext().getString(R.string.crop_unavailable), Toast.LENGTH_SHORT).show(); // return }...

jQuery cropit plugin check if current image is zoomable

jquery,crop
I use this plugin to crop images: http://scottcheng.github.io/cropit/ I want to know how to find out if the current image is zoomable so I can hide the zoom div if not, it says this function is for it: $imageCropper.cropit('isZoomable'); But how t use it? I'm a beginner in jQuery. This...

Call re-sizing function after lazy loading of image

jquery,image,crop,resize-crop
I am trying to call re-sizing function after lazy loading of image. I have simple jquery plugin given below that can resize and crop the image to correct size by tweaking the image url. Crop JS: $.extend($.lazyLoadXT, { onload:myfunc }); function myfunc(){ var w = 200; var h = 150;...

How do I crop an image using RenderScript?

java,android,crop,renderscript
I want to be able to crop an image using RenderScript. Here is my crop function: uchar4 __attribute__((kernel)) crop(const uchar4 in, uint32_t x, uint32_t y){ int minX = centerX - cropWidth; int maxX = centerX + cropWidth; int minY = centerY - cropHeight; int maxY = centerY + cropHeight; uchar4...

Crop an image to a square in iOS

ios,image,crop,rotatetransform
In my app I import an image from either the camera or the photo library using a UIImagePickerController. Than I save the imported image to the app documents directory. This all works fine, however I would like to save the image cropped as a square(like on instagram) instead of it's...