Crop an image

Hello Everybody ,
There is someone who can help me with a bean that crop a part an image and then save it in DB with more informations??
Please i need ur helps .

In BufferedImage you have the getSubimage(int x, int y, int w, int h) and getRGB(int x, int y).
Or if you want to handle large image you can use JAI and there you have the crop operation.
The hard part here would be to determine what you call empty space, but I guess that you can scan all lines and see if they only contain the background color. When you find a row that is not entirely empty you know the top row.
Do similar at the bottom to determine lowest line to keep.
For left and right you have to scan pixels in column mode, but otherwise similar as above.
I guess that you want to keep one or two lines of empty space, but you will have to try it yourself.

Similar Messages

  • I have 4 equal oblong shape created with borders How do I go about knowing what size the selection area is so that I can crop an image to fit. I don't want to use paste in then adjust the bounding box to suit

    I have 4 equal oblong shape created with borders How do I go about knowing what size the selection area is so that I can crop an image to fit. I don't want to use paste in then adjust the bounding box to suit

    What do you mean a moderator

  • Is there any way to prevent Aperture from Auto Cropping an image?

    Is there any way to prevent Aperture from auto cropping an image? I use the "Do Not Crop" aspect ratio often and Aperture constantly picks cropping aspects for me, which is driving me crazy. Can I set "Do Not Crop" as the ratio I want on a more permanent basis anyhow? Thanks for the help.
    Chris

    This is a current bug.  Please report it via "Aperture→Send Aperture Feedback".
    Just to clarify, the problem is not auto-cropping, the problem is the the crop tool aspect ratio is arbitrarily set (in my case, always to something close to the current crop aspect ratio).  You can reset it (on a per-crop basis) to "Do not constrain".
    It is very bothersome.
    You might try trashing your prefs.  Details on the Trouble-shooting page.  I have had the bug return more than once.
    Message was edited by: Kirby Krieger -- minor clarifications.

  • Do all the "themes" automatically crop the image?

    I tried all six themes - and all six of them crop the image in one way or another.
    is there any way to avoid this? is there a theme or something I can do to show the entire image on the slide show?
    thanks!
    WF

    What aspect (size) ratio are your photos? Most of the themes, books, etc. are designed to a 4:3 aspect ratio as that's usually what most digital cameras create. You also have to set the display aspect ratio to 4:3 to avoid cutting off any of the photos (see bottom of screenshot below):
    Click to view full size
    The one theme that does not work is Sliding Panels as it uses frames that are not 4:3.

  • How do I crop an image in photoshop and place it in an illustrator file without having a white backg

    How do I crop and image in photoshop and place it in an illustrator file without having a white background ?

    Could you post the image (or a lores version of it) on this Forum?

  • How do I crop an image in Flash?

    I've been croping my pictures to use in my flash in photoshop but I want to crop the pictures so they fit the size of my page in flash. Does anyone know how to crop pictures in flash?

    There is no tool to crop the image, you can make an mask on it but still the whole image resides within the stage. May be you can break apart and remove the unwanted sides, but not for practice.

  • Can you crop an image in Flex?

    Hi.  I am writing a small Air application in Flex where a bunch of images will be imported at a resolution of 120x80 pixels.  To use them in the application, I need them to be square at 80x80 pixels.  Right now they are squished because I am forcing the 120x80 image to fit into and 80x80 container.  To make it look more professional, I need to crop the images to 80x80 pixels.  Is there a way to do this in Flex, and if so, how?  Thanks.

    Once the images are cropped to 80x80 pixels, the images will be manipulated by rotating and moving them.  Because of this, I thought that cropping them would be a better alternative to masking(I don't know if masking also masks mouse-overs and things like that, which is why I thought about cropping)
    So if anyone knows how to crop an image in Flex, I would love to hear it.  Or if you know of any good resources or tutorials for it, could you point them out.  Thanks.

  • Do I need to export multiple sizes for all standard print sizes? i.e.Say I crop the image in LR to 6'5" x 9' to fit within an 11" x 14" (overall) mat of a framed print.. Now let's say I want to reprint that same image in a 12" x 16" size ... to fit within

    Do I need to export multiple sizes for all standard print sizes? i.e.Say I crop the image in LR to 6'5" x 9' to fit within an 11" x 14" (overall) mat of a framed print.. Now let's say I want to reprint that same image in a 12" x 16" size ... to fit within a mat of with overall size of 20" x 24"? Or will the 1st export be "locked" at 6.5" X 9" (proportionately)?

    So, for the first one Export it cropped to 6.5 x 9 - and in the Export Dialog box there is a capability to rename the file for exported output - which would allow you to add something like the crop or intention to the base name of the file.  e.g. for _IMG0846.nef - setup the output filename to _IMG0846-65x9 for 11x14.jpg and output it at, say 300 or 360 dpi.  So, it has a unique name and purpose in your output folder.
    For best results, now, re-crop the picture in LR - just open the crop [R] dialog again, reframe the image to the new ratio, 12x16 and Export again - with an adjustment to the filename. e.g. _IMG0846-12x16 for 20x24.jpg
    So, now you have two clearly identified image files in your output area and you can provide those to whomever is printing for you, etc.  Discard them when you're done since you always have the original to return to to re-frame again as necessary.
    This way you get output sharpening and resolution (in pixels) optimized for your output print size.  Maybe not super important for smallish prints-but more important for larger ones.   Output at 100 quality.

  • Can't crop an image in CC2014

    Hi  I can't crop and image in photoshop. I keep getting the message "Cannot complete your request because of a program error".
    I tried resizing the canvas and received the same error.
    I uninstalled (removing preferences and reinstalled the photoshop app but still get the same error.
    I am in windows 7 Service pack 1. 
    Thanks in advance  for any good ideas on resolving this problem.
    Rose

    Sounds frustrating. Have you tried chatting with Adobe tech support? They're in India, but very smart and very polite. It may take awhile (like an hour), but they've been able to solve every issue I've had so far ...
    http://helpx.adobe.com/contact.html?step=PHSP
    Fill out the details until you see the "Contact Us" link, which leads you to the CHAT link. Be patient, and they will certainly tell you how to solve the problem.
    Good luck.

  • Apple's Preview App ( Unable to Undo Crop to Image)

    Hi Guys i made a mess i cropped an image and selected save instead of save as but it doesn't show an undo option is there anyway of undoing the problem?
    Like a cached copy of it somewhere?
    At wits end guys
    Cheers
    Garret

    Restart the system and see if there is a "Recovered Files" folder in the trash. Preview often leaves the original file there when it does a save.

  • How do I crop an image to 3.5 x 5

    I'm trying to match the size and aspect ratio of an older photo.  The old photo was printed at 3.5" x 5.0".
    How do I crop an image with Aperture to 3.5x5.0?
    Thanks.

    When you crop, the only control is the aspect ratio. You can crop an image with a custom ratio by selecting "custom" at the bottom of the aspect ratio popup menu in the Crop HUD that appears while in the Crop command.
    The size only matters when you print the image. In the print dialog you can set the size in inches of the printed image. The dpi of the printed photo will depend on the pixel size of the image divided by the printed size in inches.
    If you want to control the exact dpi of the printed image, you'll need a pixel editor such as Photoshop.

  • Something is wrong with the cropping.  It won't let me crop the picture.  Usually the arrow would appear so I can drag it to crop the image but now the little hand appear and does not change to the arrow.

    I cannot use my crop function in editing.  The little hand would not change to the arrow hence cannot drag to crop the image.  It just happened today.

    Lets start with details - what version of iPhoto and of the OS?
    anything else that might help figure this out?
    LN

  • Cropping an image to a specific but non-standard size

    Can anyone tell me how to crop an image to a size other than the standard sizes listed in the crop tool (e.g., 11 x 14)? This is easily done in PS Elements, but I'd like to avoid exporting and creating a duplicate of a large file just to crop for printing.
    Also, is there a way to display the size of an image in inches as opposed to pixels? this would be handy after it is cropped.
    Thanks!

    Just click into the width and height boxes in the crop tools dialogue box and check Constrain constrain cropping tool to:
    You set the size in inches or whatever on export. When the file is within Aperture it has no size other than pixels.
    Cheers,
    Terry

  • Error: "Scratch disk is full" when cropping an image

    Solution suggested by PECourtejoie.
    Issue: When you try to crop an image in Photoshop and enter width, height and resolution values in the crop options, you receive the error that the scratch disk is full and are unable to crop the image.
    Details: If you leave the crop options blank, you can crop the image successfully. This usually occurs because you left a resolution target in the options for the crop tool and it is attempting to resample your image to something bigger than your scratch disk can hold
    Solutions: Do one of the following:
    Solution 1: Clear the crop tool options.
    Click the Clear button on the crop tool options bar to remove previously entered measurements and the target resolution.
    Solution 2: Specify measurement units when cropping.
    Enter the desired measurement units in the width and height crop options. For example, enter 100px for pixels, or 1in for inches. Remove any text from the resolution field.
    Solution 3: Set the default measurement units.
    To set the default measurement units:
    1. Choose Edit > Preferences > Units & Rulers (Windows) or Photoshop > Preferences > Units & Rulers (Mac OS).
    2. Select a measurement unit for Type under the Units section of the Preferences dialog box. For example, select Pixels.
    3. Click OK.
    Message was edited by: PECourtejoie

    Thanks!
    You did credit me, but the text you picked comes from a Knowledgebase article... no one hurt, just setting things straight...

  • How can I create side bars without cropping the image?

    I want to create side bars because I am projecting in an vertical panel, but if I crop the image them I only get the middle part of it.
    How can I create side bars in an way that I can still move the image inside?

    On a Video Track directly above the clip(s) you want to have behind the side bars, place a clip of Color (or whatever you want to use for your sidebars).
    Now go to the Effects Tab > Matte >Mask Shape and drag the Mask Shape filter to the Color clip you have placed on the timeline.
    Double click on the clip to open it in the viewer, and click on the Filters Tab.
    Click Invert Box, and adjust the shape to get the side bars you want.
    And now the clip(s) that are beneath this effect will have the side bars and be independent of it, so that you can move them around.
    MtD

  • Lightroom 3, 4 & ACR crop my images

    When processing raw images from my Canon (550D and S90), LR crops approximately 200 pixels on the left on the image. I tried several other software (DxO for instance) that doesn't crop my images, and give me access to the full sensor of my camera. I don't think this is normal for a so-called professionnal software.

    it is under the testing phase so don't worry use lightroom 3
    but we are glad that u r giving us all the things that need to be improved in the application

Maybe you are looking for