Questions tagged [crop]

Crop refers to any issues relating to cropping images.

Cropping refers to the removal of the outer parts of an image to improve framing, accentuate subject matter or change aspect ratio.

Image example :

enter image description here

3129 questions
11
votes
3 answers

Obey the MediaBox/CropBox in PDF when using Ghostscript to render a PDF to a PNG

I've been using Ghostscript to convert my single figure plots rendered in PDF to PNG: gswin32c -sDEVICE=png16m -r300x300 -sOutputFile=junk.png ^ -dBATCH -dNOPAUSE Figure_001-a.pdf This works in the sense I get a PNG out and it contains the…
user319080
  • 121
  • 1
  • 4
11
votes
2 answers

Android auto crop camera captured images

I am looking for some kind of auto trim/crop functionality in android. Which detects a object in captured image and creates a square box around object for cropping. I have found face detection apis in android, but my problem is captured images are…
Dory
  • 7,462
  • 7
  • 33
  • 55
11
votes
4 answers

openCv crop image

I running into problems with my openCv IplImage cropping. Assuming both tmp and img are IplImage* . Using the code: printf("Orig dimensions: %dx%d\n", img->width, img->height); cvSetImageROI(img, cvRect(0, 0,500,500)); tmp =…
Johann
  • 273
  • 1
  • 6
  • 11
10
votes
3 answers

Crop/trim a JPG file with empty space with Java

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…
Christopher Klewes
  • 11,181
  • 18
  • 74
  • 102
10
votes
1 answer

Python script to remove blank pages using pyPDF

I am trying to write a couple of python scripts using pyPDF to split PDF pages into six separate pages, order them correctly (usually printed front and back, so every other page needs to have its subpages ordered differently), and remove resulting…
rpeck1682
  • 172
  • 2
  • 11
10
votes
3 answers

Python: How to cut out an area with specific color from image (OpenCV, Numpy)

so I've been trying to code a Python script, which takes an image as input and then cuts out a rectangle with a specific background color. However, what causes a problem for my coding skills, is that the rectangle is not on a fixed position in every…
Keanu
  • 211
  • 1
  • 4
  • 12
10
votes
1 answer

Cropping a PDF / Adding crop box using Ghostscript

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…
Brian
  • 2,107
  • 6
  • 22
  • 40
10
votes
3 answers

Editing is not supported for this Image in Oreo Version problem

Editing is not supported for this Image in Oreo Version problem. (Editing is not supported for this Image)this Toast showing when select the Image from gallery in Oreo Version mobile. I already asked this question but no one reply me. Please check…
10
votes
0 answers

CropperJS cropper Destroy Issue fengyuanchen/cropperjs

I am trying to destroy cropper when model close here is my code i am using https://github.com/fengyuanchen/cropperjs var image = document.getElementById('image_cropper'); var cropper = new Cropper(image); cropper.destroy(); cropper = null; var…
M Arfan
  • 4,384
  • 4
  • 29
  • 46
10
votes
3 answers

Center crop a numpy array

I am trying to crop a numpy array [width x height x color] to a predefined smaller dimension. I found something that should do what I want but it works only for [width x height] arrays. I don't know how to make it work for a numpy array that has an…
Vic
  • 825
  • 2
  • 8
  • 12
10
votes
2 answers

Most efficient way to crop image to circle (in R)?

TL;DR: What is the most efficient way to crop a rectangular image to a circle? Explanation/Background: I'm working on some code in R that will display Spotify artist images as circles instead of the default rectanges/squares. I couldn't find any…
cass
  • 858
  • 1
  • 10
  • 17
10
votes
1 answer

Stop crop for cropper js outside the image

Need to stop crop once the user drags cursor out of the image while cropping. My problem is once the user moves out of the image and comes back the cropped corners are moved away from the cursor. which should not happen. Below is the simple demo…
CodeZingat
  • 229
  • 3
  • 14
10
votes
1 answer

How to destroy Croppie jQuery existing instance?

I've using Croppie jQuery Library for crop a image but facing a problem when it will create multiple instances. I've found no documentation about destroy instance. function initCrop() { var $uploadCrop; $('#image_crop').destroy(); …
Govind Samrow
  • 9,981
  • 13
  • 53
  • 90
10
votes
1 answer

How to crop a polygonal area from an image in a WinForm pictureBox?

How can I crop a part of an image with a polygon? For example I have 6 coordinates and I would like to cut this part of an image.
sadegh
  • 1,720
  • 1
  • 16
  • 30
10
votes
1 answer

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

I am learning about Grafika's "Continuous Capture" Activity, It is about recording a video with MediaCodec. The activity source code is at https://github.com/google/grafika/blob/master/src/com/android/grafika/ContinuousCaptureActivity.java The…
dragonfly
  • 1,151
  • 14
  • 35