Home Answers Viewqa Java-Beginners Jmagick how to add image on an existing image

 
 


Java Coder
Jmagick how to add image on an existing image
1 Answer(s)      9 months ago
Posted in : Java Beginners

hi,

I am using Jmagick library in my swing application I want to add an image (say logo) on an existing image. can any one explains how ?

Thanks.

View Answers

August 23, 2012 at 12:52 PM


hi,

In Jmagick you can use the following code to add image on an existing image

You can give one of the following value according to opacity you want to give your image

  1. CompositeOperator.OverlayCompositeOp

  2. CompositeOperator.SoftLightCompositeOp

  3. CompositeOperator.HardLightCompositeOp

For providing the custom opacity you can constitute the following method along with these above value

transparentImage(PixelPacket.queryColorDatabase("ColorName"),int opacity value (0-65535)); Here 0 specifies the fully opacity and 65535 specifies the fully opaque.

Following code may help you to understand how to use these methods and values in to adding an image to an existing image.

ImageInfo ii = new ImageInfo("abc.jpg");
MagickImage mi = new MagickImage(ii);

ImageInfo logoImage = new ImageInfo("logo.jpg");
logoImage.setSize("120 * 60");
MagickImage logo = new MagickImage(logoImage);
logo.transparentImage(PixelPacket.queryColorDatabase("white"),0);
mi.compositeImage(CompositeOperator.OverlayCompositeOp, logo, 120, 80);
mi.setFileName("newImage.jpg");
mi.writeImage(ii);









Related Pages:
Jmagick how to add image on an existing image
Jmagick how to add image on an existing image  hi, I am using Jmagick library in my swing application I want to add an image (say logo) on an existing image. can any one explains how ? Thanks.   hi, In Jmagick you
How to write image in Jmagick
How to write image in Jmagick  hi, I am new in Java I am using the Jmagick library, how can I write an image in Jmagick ? Thanks.   hi, You can try this snippet into your code ImageInfo ii = new ImageInfo("abc.jpg
Jmagick get image size
Jmagick get image size  Hi, How I can get the image size while using the Jmagick library? Thanks   hi, the code given below may help you to get the image size when using Jmagick ImageInfo ii = new ImageInfo(path
Jmagick crop image
Jmagick crop image  hi, How can I crop the images using Jmagick Thanks.   hi, To crop an image you can use the cropImage() method of MagickImage. Following code explains how an image may cropped ImageInfo ii = new
image
image  how to add the image in servlet code
How can I generate diff image using Jmagick?
How can I generate diff image using Jmagick?  Hi, I used 'compare' in ImageMagick to produce diff image with metric. example: $ compare -verbose... Jmagick. Can anybody help me get a diff image with similar metric using Jmagick
Jmagick write image to a specific folder
Jmagick write image to a specific folder  hi, I am writing the code for resizing the images into which the image will be get from one location and save the resized images to the another location. for example : get an image
Jmagick
Jmagick  can any one help me out ...how to use jmagick with servlets and jsp and its installation process also............ its very urgent....... thanx ina adv
Image
Image  how to insert image in xsl without using xml. the image was displayed in pdf..Please help me
Image
Image  how to insert image in xsl without using xml. the image was displayed in pdf..Please help me
Image
Image  how to insert image in xsl without using xml. the image was displayed in pdf..Please help me
How to write text on image
How to write text on image  hi, I am using the Jmagick library. I want to write text on image, how is it possible ? Thanks.   hi, I am new in Jmagick but, I used the following code and it might also help you
UIView Image Background
; Existing Files -> and browse and select the image file that you wanted to add... out how you can add image as a background using UIImageView. In your project...UIView Image Background In this tutorial, we are going to show you how
How to add image in panel as background in net beans IDE?
How to add image in panel as background in net beans IDE?  How to add image in panel as background in net beans IDE
PHP GD add text to image
PHP GD Add Text to Image Example <?php header ("Content-type: image/jpeg"); $string = "This is my text"; $font = 4; $width = imagefontwidth($font) * strlen($string) ; $height = imagefontheight
PHP GD add text to image
PHP GD  Add text to Images <?php $im = imagecreatetruecolor(300, 300); $w = imagesx($im); $h = imagesy($im); $text...: image/gif'); imagegif($im); imagedestroy ($text); imagedestroy($im); ?>
add image in a row of table
add image in a row of table  i have a table in which i have to add image in its row.i am trying to add the image with the help of label i.e i have a label in which instead of passing text i have inserted image using
add image in a row of table
add image in a row of table  i have a table in which i have to add image in its row.i am trying to add the image with the help of label i.e i have a label in which instead of passing text i have inserted image using
browse image
browse image  how to browse the image in image box by browse button and save image in database by save button by swing   import java.sql.... java.awt.image.*; import java.awt.event.*; public class UploadImage extends JFrame { Image
browse image
browse image  how to browse the image in image box by browse button and save image in database by save button by swing   import java.sql.... java.awt.image.*; import java.awt.event.*; public class UploadImage extends JFrame { Image
Browse an image
Browse an image  hi................ i want to browse an image from the folder and display in form of my project..... can u tell me how to do... java.awt.event.*; public class UploadImage extends JFrame { Image img; JTextField
Background Image for Navigation Bar
Background Image for Navigation Bar The tutorial illustrates how to add background image for UINavigationBar. To add a background image to UINavigationBar... the change on every view. Do not forget to add image into your resources folder
how to set image - EJB
how to set image   public ActionForward execute(ActionMapping mapping... coding to ireport. this coding only getting database fields. i need add one image in this pdf, how can i set pls help me sir, my image in E:/rose.jpg,how can
set background image in javafx
set background image in javafx  Hi, How to add backgroung image in javafx integrated with jswing
UIView Background Image
UIView Background Image  HI, Please let's know how to add background image to a view? Thanks   Hi You can use the following code...:@"myimage.png"]]; Read more at UIView Image Background Tutorial page. Thanks
Crop Image
Crop Image       This section shows you how the image get crops. To crop an image.... To produce image data for a filtration of the original image, we take an existing
UITableViewCell background image
iPhone application. I have to add the background image to UITableViewCell. Please tell me how to add UITableViewCell background image. Thanks   Hi, Here is the code example of UITableViewCell background using image. UIView
Image Resize in Flex
Image Resize in Flex  Hi....... I am going to add images into a tag. How will it resize itself? Please tell me about that.... Thanks  Ans: The image resize is the part of laying out of your application. you
Image Processing Java
; import com.sun.media.jai.widget.DisplayJAI; /* * Shows how to save an image...); f.getContentPane().add(new DisplayJAI(image)); f.pack(); f.setVisible(true...Image Processing Java  Using This Code I Compressed A JPEG Image
UITextField Background Image
UITextField Background Image  How can i set a background image... wanted to add a small image on text field as a right or left view. Find the code below.. on how to set the uitextfield leftview image.. - (void)viewDidLoad
PHP GD text on image
<?php header("Content-Type: image/jpeg"); $im = ImageCreateFromjpeg("images.jpg"); $black = ImageColorAllocate($im, 255, 255, 255); $start_x = 10; $start_y = 20; Imagettftext($im, 12, 0, $start
how to update image in php
how to update image in php  how to update image in php
image in database
image in database  how to set image in database and retrieve it using servlet(java)in msaccess
Image_creation
Image_creation  how to create an image from a set of pixel values stored in array - in java
Button with Image
: 1. Image should be added into the resource file: To add the image in resource file...select and right click on it & choose Add ->Existing file. Now Select the file and click on ->add -> add It'll add the image file
How to create a JTable cell containing Image hyperlink?
How to create a JTable cell containing Image hyperlink?  I'm trying to find out how to create a JTable cell which contains Image, which should.... Can somebody explain me how to add hyperlink (mouse listener) for the each
iphone Touch Image
iphone Touch Image In this tutorial, will learn how to use Image View in the application and also how to set the image on the Image View and then will see how... view using the variable of Image View. Add this to ViewController.h file
scrolling image
scrolling image  How create a scrolling image in java
UIButton with image
UIButton with image  Hi, How to create UIButton with image? Thanks
TextField on the Image
TextField on the Image  how we set label or textfield etc. on the Image
Icon image
Icon image  hiii how can we set image on the icon by which we can launch the application???   hello, when you will save a image named icon.png then it is automatically show this image on the icon
Photoshop change a background image
) of the image which you want to add. Inverse: After selection, go to select menu... to add another background image. Open another image: Now open another image to add as background image. Here,  I have taken an office image
image retreival
image retreival  I ve stored the path of image and audio in mysql database. how to retrive it and display... Can u pls help me out
how to insert image into server
how to insert image into server  how to insert an image into sql server and retrieve it using jSP
iphone Image Move
iphone Image Move In this tutorial will learn how to use Image View into view with background image set and that image can be moved any where on the view... file we are setting the image onto the view in center of the screen. Add
Display Image on JDesktopPane
Display Image on JDesktopPane In this section, you will learn how to retrieve an image from  the database and display it on the JDesktopPane. You can see...); f.getContentPane().add(new Pane(image)); f.setSize(300, 100); f.setVisible(true
how to set background image
how to set background image  how to set image in background in that image i want over lay text how it possible in jsp? using flash image how it is overlayed in jsp page? thanks
image display
image display  Hai Friends..... Actually I uploaded filepath into database and image into a folder. Now i want to show that image as my profile photo. How it is?...Friends Can you help me? Thanks in advance to take time
image display
image display  Hai Friends..... Actually I uploaded filepath into database and image into a folder. Now i want to show that image as my profile photo. How it is?...Friends Can you help me? Thanks in advance to take time
image steganography
image steganography  Hello.could you please tell me how to start developing code for image steganography?could you provide some key points showimg its implementation

Ask Questions?

If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.

Ask your questions, our development team will try to give answers to your questions.