Results 1 to 8 of 8
Like Tree3Likes
  • 2 Post By DarrylBurke
  • 1 Post By Fubarable

Thread: Need Help and suggestion in handling the Jpeg images

  1. #1
    Join Date
    Aug 2009
    Posts
    14
    Rep Power
    0

    Question Need Help and suggestion in handling the Jpeg images

    Hi Everyone,

    Am currently working on one project where i need to merge (combine) Two jpeg images,
    Problem is I have two images,1st need to create one Blank image using java for specified Width and height, 2nd is I have one more image which is smaller than the Created image and i need to merge the 2nd image with the 1st image from center, It is Some thing like in photoshop we use add two image and merge them in center need to perform Similar activity using java.

    My worries are:
    1. Is it Possible using java.
    2. How easily we can do it

    Please help me out by your suggestion

    Thanks a lot in advance

    Keep smiling

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Need Help and suggestion in handling the Jpeg images

    If you simply want to display one image over the other, then you can put both into ImageIcons, place the ImageIcons into JLabels, give the larger JLabel a GridBagLayout, and then add the smaller JLabel to the larger one.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,305
    Rep Power
    20

    Default Re: Need Help and suggestion in handling the Jpeg images

    Or you could use camickr's Compound Icon/.

    db
    Fubarable and naveen.dpt2007 like this.
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    Join Date
    Aug 2009
    Posts
    14
    Rep Power
    0

    Default Re: Need Help and suggestion in handling the Jpeg images

    Sorry missed out one thing, After merging both the images output will be jpeg image (Combining two images into one image)

  5. #5
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Need Help and suggestion in handling the Jpeg images

    You can create a BufferedImage the size of the larger image, extract a Graphics object from the BufferedImage, draw the larger image into the BufferedImage using the Graphics object, and then draw in the smaller image centered using simple algebra, dispose of the Graphics object, and then using ImageIO write out your new JPG from the BufferedImage.
    naveen.dpt2007 likes this.

  6. #6
    Join Date
    Aug 2009
    Posts
    14
    Rep Power
    0

    Default Re: Need Help and suggestion in handling the Jpeg images

    Can you help me how centric logic using please

  7. #7
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Posts
    19,316
    Blog Entries
    1
    Rep Power
    26

    Default Re: Need Help and suggestion in handling the Jpeg images

    Quote Originally Posted by naveen.dpt2007 View Post
    Can you help me how centric logic using please
    Nah -- you surely can figure that out! It's nothing more than trivial algebra.

    I'll tell you what. If you do get stuck, then post your SSCCE-compliant attempt and we'll have a look. But I still think you'll figure it out in 3 minutes.

  8. #8
    Join Date
    Aug 2009
    Posts
    14
    Rep Power
    0

    Default Re: Need Help and suggestion in handling the Jpeg images

    Ok let me try, Thanks a lot for your help... i will get back to you with result..... :-)

Similar Threads

  1. Replies: 4
    Last Post: 12-16-2010, 04:32 PM
  2. Help with moving jpeg files
    By Umi in forum New To Java
    Replies: 11
    Last Post: 09-30-2009, 01:11 AM
  3. Scaling a JPEG
    By ScottVal in forum Advanced Java
    Replies: 5
    Last Post: 03-21-2009, 08:47 PM
  4. Save image as JPEG
    By aartheesrini in forum Java Applets
    Replies: 1
    Last Post: 03-16-2009, 05:56 AM
  5. extracting text from jpeg
    By Nicholas Jordan in forum Advanced Java
    Replies: 0
    Last Post: 10-05-2008, 11:40 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •