Print images in PNG and BMP formats

I have converted images from xwd to bmp by using JAI. now I want to print them.
How can I print PNG and BMP Files? How can I read images in different formats and make them print.
Please help me !

JAI follows the Java 2D printing model. All you need to do is to read your PNG, BMP images as RenderedImage, Renderable, or BufferedImage objects. To print an image, draw the image object on the printer's graphics context using one of drawImage(), drawRenderedImage(), and drawRenderableImage() methods of the Graphics2D class.
I have some sample code at http://www.geocities.com/larryhr/samplecode/samplecode.html. See the Printing section. JAIImagePrint.java should give you some indication as to how to print images read by the JAI codec.

Similar Messages

  • Convert a Tiff Image to png and show

    Hello;
    I wanto to convert a Tif image to png and show this in my web page but i dont want to save the png iamge in my server.
    Actualy i do that:
    byte[] bytes = imagenData;
                    ByteArraySeekableStream tiffStrm = new ByteArraySeekableStream(bytes);
                    String[] CdcNms = ImageCodec.getDecoderNames(tiffStrm);
                    ImageDecoder tifDecoder = ImageCodec.createImageDecoder(CdcNms[0], tiffStrm, new TIFFDecodeParam());
    //                 Check the number of pages
                    int IFDs = tifDecoder.getNumPages();
    //                 Get the first page
                    RenderedImage ren = tifDecoder.decodeAsRenderedImage(1);
                    byte[] bytes2 = doSingleConversion(ren);AND
    protected byte[] doSingleConversion(RenderedImage tifImage) throws Exception
              byte[] bytes = null;
              String out = "temp.png";
              try {
                   //      Create the PNG file
                   PNGEncodeParam pngParm = PNGEncodeParam.getDefaultEncodeParam(tifImage);
                   JAI.create("filestore", tifImage, out, "PNG", pngParm);
                   //Read the file into a byte array
                   File f = new File(out);
                   FileInputStream in = new FileInputStream(f);
                   bytes = new byte[(int) f.length()];
                   in.read(bytes);
                   in.close();
                   return bytes;
              catch(Exception e) {
                   e.printStackTrace ();
                   throw(e);
         }But this code save de image in the server; it�s posible do it without save.

    Numbers the iWorks program? Not sure you can convert it to that or just a list of numbers. Never heard of anyone that would even want to convert an Image file, Photo, to any other format. Other then another image format like JPG, PNG or a PSD Photoshop file.

  • Corrupt Screen Shots (png and tif)

    Hi
    I and a few screen shots which I took some months back using the 'shift-command-3' key combination. They were saved in .png and .tif formats.
    I opened them today to find that the .png ones were all black (i.e., corrupted) and the .tifs appeared in negative 'white and black' images rather than colour.
    Any idea what's gone wrong here? Or how to recover the images?

    The easiest way to change the format is to download the free app OnyX. In OnyX go to Parameters/General and change the screen shot format to jpg. From that point forward the screen shots you take with those keyboard commands will be jpgs.
    http://www.titanium.free.fr/download.php?sid=b7bf7f330825adff63b3dbf74eaa4b55

  • Print Images' Contact Sheet problems from specific camera...

    I have printed a couple contact sheets (Print Images > Contact Sheet), and all the thumbnails for RAW files from a Panasonic DMC-LX2 all come out squooshed into a square, no matter what the actual orientation of the file is. I have forced an update of the previews and there is no change. Is this a common problem for others? In the preview for printing single images to a page, the images appear normal, but with contact sheets the images from this camera come out square. No problems with my Canon files or other JPGs.
    I suspect there is no work-around, but ask just in case. It would be nice if there is, as the contact sheets are for a copyright registration, and the square makes the image possibly illegible in the eyes of a future court, if it ever got to that.

    HAs this already been discussed and fixed? hopefully?
    It appears to be a bug.
    http://discussions.apple.com/message.jspa?messageID=3553568&tstart=0

  • PNG colour profiles - and this format for print

    I know it's taboo to talk about PNG for printing.
    But I can't find and I've searched the forums - there was a post made about embedding colour profiles a while ago.
    I know PNG is a RGB only format, but I'm 36.8% sure I read something about embedding either RGB or ... wait for it CMYK profiles into PNG files.
    If anyone can shed any light on this - and how about PNG for print - I've been against it for a long time - but it is a lossless format, it can carry 64 bit data.
    I know I know - but I thought I'd ask anyway - see what people think.

    You can't save a PNG with a profile out of Photoshop, but it looks like you can embed one via the image events scripts that ship with OSX (/Library/Scripts/ColorSync/embed). Unfortunately ID ignores the embedded profile and uses the document's assigned profile instead. PNGs do respond to ID's RGB profile and the RGB profile will have an effect on the CMYK separation when it happens.
    Here's ProPhoto and sRGB:
    From your ID document you can also assign a profile, which conflicts with the doc's profile, by selecting the png and choosing Image Color Settings.... So, you could assign AdobeRGB as your doc's profile and assign sRGB to all your pngs.

  • So I have been creating a logo for my company and it came out great. The problem is, when I format it for PNG or when I want to use it on freshbooks or my webpage, the image becomes blurred and the text is not as clear. How do I fix this?

    So I have been creating a logo for my company and it came out great. The problem is, when I format it for PNG or when I want to use it on fresh books or my webpage, the image becomes blurred and the text is not as clear. How do I fix this? Is it because the text get shrunk?

    This is how it looks on adobe illustrator

  • The crawled property of Image width and height - is there a differnce when the image is png format?

    Hi,
    We are indexing file share with images and get the properties of Image Width, Image Height, Image Size (we show it as refiners in SharePoint after make it managed properties). Somehow when the picture is png format - we see only Size but not height and width.
    Is that any setting that should be done in the file share (when i select an image in the windows explorer window i can see all its properties, and it seems that png files do expose the width and height properties
    keren tsur

    Hi  Keren,
    According to your description, my understanding is that when you tried to  crawl file share with images, the ows_ImageWidth and ows_ImageHeight crawled property for PNG  file could not be generated.
    For your issue, I can reproduce your issue in my SharePoint 2013 environment. For a workaround, you can upload the PNG images into SharePoint images Library and they would work fine.
    Best Regards,
    Eric
    Eric Tao
    TechNet Community Support

  • "print" command in Mathscript not saving plots in BMP format!

    Hi guys,
    i am trying to create a vi that will automatically generate a pdf report for my project. I found a way to save the report directly as pdf (that is, i "print" my report to a virtual PDF printer (PDFCreator) that saves the file automatically to a specific folder with the date/time as its name. So this was the first step to making the procedure automatic).
    I am stuck in the next level, which is adding to the report not labview's bad-looking graphs, but the plots generated through the Mathscript.
    So, after adding as input "a" my data to the mathscript node, i use the following commands:
    figure
    plot(a)
    print image
    Now, what this sequence does is make a nice plot of my data and then save it as "image.eps" in the default folder.
    However, the eps format is not at all useful to me as i cannot import the plot with the "Append Image To Report.vi". This vi supports only BMP, GIF, WMF, EMF and JPG formats.
    So, i want to save the plot from mathscript as BMP. This is supposedly possible, however i have not been able to find a way. The "print" command help for Labview 2011 Mathscript reads:
    http://zone.ni.com/reference/en-XX/help/373123B-01/lvtextmath/msfunc_print/
    Syntax
    print
    print(a)
    print(file)
    print(a, file)
    Description
    Print the plot window or save it into a file in either BMP or EPS format. If the plot window to save is an image plot or a 3D plot, the file must be in BMP format. For other kinds of plots, both BMP and EPS formats are supported.
    There is no way for me to choose which format i want and it automatically chooses eps. If i use the command
    print image.bmp
    it gives me back an error. So, adding the .bmp ending is not the way to go.
    All in all, it is crucial for me to export the plot in BMP format (so as to import it in the report generation), but i cannot find a way, althouth it is supposed to work.
    Any ideas????
    Thanks
    PS. I run Labview 2011 SP1
    Solved!
    Go to Solution.

    Thanks a lot ttrr!!

  • For black and white images in technical manuals, which format do you prefer?

    So, I'm new at this company, and the person who is training me uses the EMF format for the images on the manuals.
    Do you think a PNG file would be a better option for illustrations?

    > ... 90% of the manuals are digital (burned into a CD)
    Presumably as PDFs, which the ends users then either view on line or print locally?
    > ... and 10% are printed in grayscale.
    On what type of press?
    You probably want the images optimized for on-line viewing.
    In the case of line art, this means staying in vector form, so that it scales cleanly, and using a stroke weight that is optimized for typical resolutions and convenience printing.
    In the case of raster art, this means having enough resolution to maintain detail at reasonable zoom, and on convenience printers.
    For vector, we normalize stroke weights to about 0.2 point, save as EPS and import the EPS. On Frame versions later than 7.x, PDF import might also be stable, and preserves vector as vector. SVG I haven't tested.
    For raster contone (grayscale or color), avoid JPEG in the workflow. It is lossy and introduces artifacts. Never use it for screen shots or scans. Even if your camera image is JPG, convert it to an uncompressed form during edit and post-processing, such as PSD. Our target delivery resolution for contone is 200 dpi. This is slightly more than our press can resolve, but provides a bit of zoom for PDF viewing. We save the final images as EPS, and import those. TIF is also OK for this application (uncompressed). We select the compression level during PDF generation.
    For bitmap images, again avoid JPG. We optimize these for 600 dpi (our press resolution), save and import them as TIF (EPS is really clumsy for bitmap).
    EPS is a bit annoying to work with in Frame, as what you see during edit is a thumbnail or preview (72 dpi), but what renders to Ps or PDF is original vector or full raster. But EPS is fast, rock solid, and (if you need it) can preserve original CMYK color into the Ps or PDF.

  • How to convert raster images like( PNG, JPG,GIF, BMP, TIFF etc) into SVG

    Hi Friends!
    With a hope that any Java Guru from SUN Forum can help me to solve my query, I'm posting my thread here.
    I have a project with feature to add image. My requirement is to convert any selected image file like (PNG,JPG,BMP,Tiff) into SVG Formate before adding it to Frame.
    I found one software from the link :
    http://delineate.sourceforge.net/
    Which covert raster to SVG.
    But I don't how can i use it runtime ?
    I want to convert during runtime process. like when user select option for to add Image then it call a procedure to add Image by converting any raster to svg & finally add to Frame.
    Your any help/suggestions wold be appreciated
    Regards
    Kirti

    There are basically two approaches:
    1. Embed the raster image in the SVG
    2. Vectorize the image
    1. Use Batik, or just write the XML yourself. Create some SVG files with embedded images, the syntax isn't to difficult. You could do it with a PrintWriter.
    2. Good luck to you. Writing a good vectorizer is
    - difficult
    - often pointless
    - though a great challenge if you're in to it
    The appllication you mention actually is only a front-end. it doesn't execute the vectorization itself. It uses Potrace and autotrace, which are native applications.

  • How to decoding and encoding PNG and GIF images?

    I could decode and encode JPEG images using following create functions which are in com.sun.image.codec.jpeg package.
    JPEGImageDecoder decoder = JPEGCodec          .createJPEGDecoder(inputStream);
    JPEGImageEncoder encoder = JPEGCodec                    .createJPEGEncoder(outputStream);
    But I dont know required package and functions to decode and encode PNG and GIF images. Please help me.

    Is the API that hard to follow?
    ImageIO.read( file/stream/url)
    ImageIO.write( image, format (e.g. PNG, GIF(1), JPEG), file/stream what have you)
    1) Not sure if Java supports GIF saving, it might if you install JAI, or Java 6.

  • Error message when uploading book for printing. All images are jpg and rgb. Could they be too large to upload? What size is required and how do I reduce size in Aperture?

    I receive an error message when I upload my book for printing. Not sure what the problem is. All my images are jpg and rgb. Could they be too large as it takes about 15minutes to upload to Apple. How do I reduce the size of the image in Aperture?

    Hi Leonie,
    Thanks for your reply.
    Error message below. The preview is fine . I can discount the first 2messages as its a new computer so plenty of disk space and upload doesn't seem to be interrupted. I have uploaded to iphoto before. have tried to upload 3times with the same error message. I had to photo my slides with a Kaiser Baas photo maker , which apparently doesn't scan but takes photos in megapixels of the slides. I am wondering now if the format is incompatible though they are jpg files or the colour type wrong. The image files are  around 1-3 mb each and  72 ppi. I think  I will now scan them properly with a scanner to 300dpi anyway to improve quality.
    Apple  talks about image files not being too big for uploading but gives no sizing of what too big is?
    Error message
    1. Upload Error. Loss of connection or file corruption during order upload may cause an incomplete order. Resubmitting your order usually resolves this issue.
    2. Low Disk Space. If your computer is running on low disk space, your files may be assembled incorrectly. Create more space by deleting unused files.
    3. Unreadable PDF file or image files. Files are sometimes assembled incorrectly due to CMYK or Grayscale color space. Use the RGB color space for best results.

  • I'm using Photoshop CS5 and there is no PNG listed under format in save as.

    I'm using Photoshop CS5 and there is no PNG listed under format in save as.    

    PNG files can only be RGB - they are intended for screen viewing. If your intention is to produce a CMYK file for printing, you must use a different format, like tiff.

  • Extract embedded png and jpeg files from InDesign, or do I even need to for 4/C printing?

    I am creating a catalog, both as a pdf for nxtBooks (online) and they want to use the same files for printing. I don't know if it's digital or, if that would even matter. I was given and old document to pull some information and images from. Some of those images appear to be embedded into their old ID document. This is not something I have ever done, but I'm old school. To make it even better, these images are old screen shots, and no one kept the originals. They appear to be scaled down in their document, so doesn't that mean there is a larger file hiding somewhere?
    On the other hand, is this necessary? I know it will be OK for online viewing, but what will happen when I create a press quality pdf? Will this cause problems for the printer?
    And while I'm at it, are printers OK with linking jpegs rather than psd or tiff files? I know the color would be more accurate if I converted, but this client doesn't particularly care about exact color matching.
    Thank You!

    But the image does not connect to anything in the links palette. It is showing up as if it were a jpeg, png or tiff, but it sure isn't acting like it. So strange.
    Pasted images don't show in the links panel. If you export the page as a PDF/X-4 and look at the image via Output Preview>Object Inspector you'll get its effective resolution, pixel dimension, and color info. Recent versions of InDesign are capable of maintaining full resolution and color properties of pasted images.
    See this thread:
    Copy | Paste vs. Place image: are they equivalent?
    If you set the scale of a pasted image to 100% and export as PDF/X-4 with no compression or downsampling, you might be able to extract the original image from Acrobat.

  • Safari 5 don't print jpg images in Windows and prints with problems in Mac

    Hi All,
    When I try to print images in Safari (Windows) it will print blank page.
    This is sample source:
    <html lang="en-US">
    <body>
    <im g src="http://img185.imageshack.us/img185/4651/wefwefwe.jpg">
    </body>
    </html>
    This is ok in Mac.
    Also in Mac When I'm printing image in Landscape it print image in 2 pages.
    Image really fits in landscape mode and there is no need for second page.
    I thought that the problem is margins..., but changing them do smaller values doesn't help.
    Can someone help out?

    Hi, I also have the same problem that cannot print preview on .jpg image.
    When I try to change image to .png , it work.
    It's this safari5 bug?

Maybe you are looking for

  • Accounting doc number for a material doc

    Hi Experts, Pls help me to know the accouting document number for a material document. Is there any functional module for the above or any table fields. currently we are developing zprogram. Appreciate for advices.

  • IPod 20GB 'Click Wheel' / Uninstalling iTunes 11. Wont Recognize. PLEASE HELP!!

    Hi everyone. Ok here's my situation. Im using a MacBook Pro (Mac OS X Lion 10.7.5) iTunes 11.4 (64Bit) iPod 4th Gen. (White 20GB 'Click-Wheel') After doing a system restore on my ancient dinosaur ipod 4th gen. (the white 20GB 'Click Wheel') and 'upgr

  • How to read files from the menu prompt

    Hi all the experts here, help me plz this is the menu R - Read a batch of student marks from a file D - Display a table of student results Q - Quit from the program when user press R the program has to read a file. The default file name is results1.t

  • Is wldeploy ANT task just always says "BUILD SUCCESFUL" ?

    Hi All, Iam using ANT and my build.xml file looks something like this: <target name="deploy-now"> <echo message="...........This is the developmenet box...deploying......"/> <wldeploy action="${deploy.utility}" upload="true" source="${source}" user="

  • Floating objects..

    Hi, I have a background image in my page. The image is a systemdrawing. I want to place textboxes containing information from a database related to different parts of the drawing. How can I place textbox objects freely though out the background image