Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



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

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


Java Coder
Jmagick how to add image on an existing image
1 Answer(s)      2 years and 4 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.


Advertisement
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 Tutorials/Questions & Answers:
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
Advertisements
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
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
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
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
image
image  how to add the image in servlet code
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
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); ?>
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 put an image on a JButton?
How to put an image on a JButton?  How to put an image on a JButton
how to update image in php
how to update image in php  how to update image in php
JMagick Tutorial
program based on JMagick. Example of JMagick that writes text on the image. Blow...JMagick Tutorial - Download, install and create simple program JMagick library is Java library for handling the image in Java. It is implemented as thin
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 insert image into server
how to insert image into server  how to insert an image into sql server and retrieve it using jSP
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
How to store an image in database
How to store an image in database  Hi........... How to store an image in postgresql using a query. I mean tell me the way to store an image using datatype. I am using the datatype bytea but tell me how to insert the image
How to store image into database
How to store image into database  Hi, all I want to store image into database using Java. Can anyone help me that how can i store image into database... through the following link How To Store Image Into MySQL Using Java
how to display image with listview
how to display image with listview  How can i display the list view with the related images from database
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
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
UIIMageView Add Image
UIIMageView Add Image "initWithImage" is a image declaring method that is used to declare the image while while creating a UIImageView. Syntax... alloc] initWithImage:one] autorelease]; //to add image on view [self.view
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 use image tag in jsp
how to use image tag in jsp  How to use image tag in JSP
How to Increase / decrease the contract of an image?
How to Increase / decrease the contract of an image?  How to Increase / decrease the contract of an image
 

 

 

DMCA.com