How to convert jpg to wbmp?

Please!!!
I need someone to teach(or tell) me how to convert jpg to wbmp!
Any help will be great!
I tried to find on web, but nothing...
Thanks!
Thales

I've never used wbmp format before, but here is a demo that I got to work:
import java.awt.*;
import java.awt.image.*;
import java.io.*;
import java.net.*;
import java.util.*;
import javax.imageio.*;
import javax.swing.*;
public class WBMPTest {
    public static void main(String[] args) throws IOException {
        URL url = new URL("http://today.java.net/jag/Image24-large.jpeg");
        BufferedImage source = ImageIO.read(url);
        BufferedImage bandw = convert(source, BufferedImage.TYPE_BYTE_BINARY);
        File file = new File("temp.wbmp");
        writeWBMP(bandw, file);
        //writeWBMP(source, file);//Only integral single-band bilevel image is supported
        BufferedImage fromFile = ImageIO.read(file);
        if (fromFile == null){
            System.err.println("read fails");
            System.exit(-1);
        JPanel cp = new JPanel(new GridLayout(0,1));
        addToPanel(cp, source, "original");
        addToPanel(cp, bandw, "black and white");
        addToPanel(cp, fromFile, "temp.wbmp");
        JFrame f = new JFrame("WBMPTest");
        f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        f.getContentPane().add(new JScrollPane(cp));
        f.setSize(850, 600);
        f.setLocationRelativeTo(null);
        f.setVisible(true);
    public static BufferedImage convert(BufferedImage source, int type) {
        int w = source.getWidth(), h = source.getHeight();
        BufferedImage image = new BufferedImage(w, h, type);
        Graphics2D g = image.createGraphics();
        g.drawRenderedImage(source, null);
        g.dispose();
        return image;
    static void writeWBMP(BufferedImage image, File file) throws IOException {
        Iterator writers = ImageIO.getImageWritersBySuffix("wbmp");
        if (!writers.hasNext()) {
            System.err.println("no wbmp writers");
            System.exit(-1);
        ImageWriter writer = (ImageWriter) writers.next();
        writer.setOutput(ImageIO.createImageOutputStream(file));
        writer.write(image);
    static void addToPanel(JPanel cp, BufferedImage image, String title) {
        JLabel label = new JLabel(new ImageIcon(image));
        JPanel labelPanel = new JPanel(new GridLayout(1,1));
        labelPanel.setBorder(BorderFactory.createTitledBorder(title));
        labelPanel.add(label);
        cp.add(labelPanel);
}The image sample format that succeeds is black-and-white (not greyscale -- each pixel is
either black or white, not a shade of grey). When I write to switch the image that was written
out to the colored version, I got the the commented error:
Only integral single-band bilevel image is supported
I don't know what color models WBMP supports, but that's not much to sing about!
You should find out if this limitation is in the wbmp image writer or in the wbmp format itself.

Similar Messages

  • How to convert JPG files to PDF

    Suggestions on how to convert JPG files to PDF using Adobe?

    You would either need the PDF Pack service, or Adobe Acrobat or Photoshop.

  • How to convert JPEG to WBMP?

    Is there a class in JAI to convert JPEG to WBMP?
    or do I have to read data from a JPEG image and convert it into binary to encode manually into WBMP format?
    I am new to Java Advanced Imagery. PLease help.
    Thnx in advance!

    If you look in the JAI documentation, it gives you a working example on how to load a jpg. It also gives you a working example on how to save a jpg, you just change the type to "bmp".

  • How to convert JPG image to BMP ? (Printing jpg images in smartforms from content server)

    Hi,
    We have employee photos(JPG Format) stored in Content server. And now we want to print the photos in smartforms. For this I had written the below code to read the photo from content server in binary format as below.
    REPORT ZTEST1.
    PARAMETERS P_PERNR TYPE PERNR_D.
    DATA: PS_CONNECT_INFO TYPE TOAV0,
          IT_BINARY TYPE TABLE OF SDOKCNTBIN.
    CALL FUNCTION 'HR_IMAGE_EXISTS'
      EXPORTING
        P_PERNR                     = P_PERNR
    *   P_TCLAS                     = 'A'
    *   P_BEGDA                     = '18000101'
    *   P_ENDDA                     = '99991231'
    IMPORTING
    *   P_EXISTS                    =
       P_CONNECT_INFO              = PS_CONNECT_INFO
    * EXCEPTIONS
    * ERROR_CONNECTIONTABLE       = 1
    *   OTHERS                      = 2
    IF SY-SUBRC <> 0.
    * Implement suitable error handling here
    ENDIF.
    IF PS_CONNECT_INFO IS NOT INITIAL.
      CALL FUNCTION 'SCMS_DOC_READ'
        EXPORTING
       STOR_CAT                    = SPACE
       CREP_ID                     = PS_CONNECT_INFO-ARCHIV_ID
          DOC_ID                      = PS_CONNECT_INFO-ARC_DOC_ID
    *   PHIO_ID                     =
    *   SIGNATURE                   = 'X'
    *   SECURITY                    = ' '
    *   NO_CACHE                    = ' '
    *   RAW_MODE                    = ' '
    * IMPORTING
    *   FROM_CACHE                  =
    *   CREA_TIME                   =
    *   CREA_DATE                   =
    *   CHNG_TIME                   =
    *   CHNG_DATE                   =
    *   STATUS                      =
    *   DOC_PROT                    =
    TABLES
    *   ACCESS_INFO                 =
    *   CONTENT_TXT                 =
       CONTENT_BIN                 = IT_BINARY
    * EXCEPTIONS
    * BAD_STORAGE_TYPE            = 1
    *   BAD_REQUEST                 = 2
    *   UNAUTHORIZED                = 3
    * COMP_NOT_FOUND              = 4
    *   NOT_FOUND                   = 5
    *   FORBIDDEN                   = 6
    *   CONFLICT                    = 7
    * INTERNAL_SERVER_ERROR       = 8
    *   ERROR_HTTP                  = 9
    * ERROR_SIGNATURE             = 10
    *   ERROR_CONFIG                = 11
    *   ERROR_FORMAT                = 12
    * ERROR_PARAMETER             = 13
    *   ERROR                       = 14
    *   OTHERS                      = 15
      IF SY-SUBRC <> 0.
    * Implement suitable error handling here
      ENDIF.
    ENDIF
    Now the issue is I want to convert that binary data to bitmap image and upload the same in to SE78. So that I can use that BMP image from SE78 in my smartforms.
    I had used the class CL_IGS_IMAGE_CONVERTER to covert the image into bmp but it is giving error that error in IMAGE DATA CORRUPT & Error Code 3. The conversion code used is as below.
    ******* CONVERT THE JPG IMAGE INTO BMP PHOTO. **********
      DATA: L_IGS_IMGCONV TYPE REF TO CL_IGS_IMAGE_CONVERTER,
    L_IMG_BLOB    TYPE W3MIMETABTYPE,
    L_IMG_SIZE    TYPE W3PARAM-CONT_LEN,
    L_IMG_TYPE    TYPE W3PARAM-CONT_TYPE,
             L_IMG_SUBTYPE TYPE W3PARAM-CONT_TYPE,
    L_IMG_URL     TYPE W3URL,
    L_ERR_CODE    TYPE I,
    L_ERR_TEXT    TYPE STRING,
             P_DEST TYPE CHAR32 VALUE 'IGS_RFC_DEST'.
      DATA: G_IMG_BLOB     TYPE W3MIMETABTYPE,
          G_IMG_TYPE     TYPE W3PARAM-CONT_TYPE,
          G_IMG_SIZE     TYPE W3PARAM-CONT_LEN.
      IF NOT IT_BINARY[] IS INITIAL.
        G_IMG_BLOB[] = IT_BINARY.
        CREATE OBJECT L_IGS_IMGCONV
          EXPORTING
            DESTINATION = P_DEST.
        CALL METHOD L_IGS_IMGCONV->SET_IMAGE
          EXPORTING
            BLOB      = G_IMG_BLOB
            BLOB_SIZE = G_IMG_SIZE.
        CASE PS_CONNECT_INFO-RESERVE.
          WHEN 'TIF'.
            G_IMG_TYPE = 'image/tiff'.
          WHEN 'JPG'.
            G_IMG_TYPE = 'image/jpeg'.
          WHEN 'PNG'.
            G_IMG_TYPE = 'image/png'.
          WHEN 'GIF'.
            G_IMG_TYPE = 'image/gif'.
          WHEN 'BMP'.
            G_IMG_TYPE = 'image/x-ms-bmp'.
          WHEN OTHERS.
            EXIT.
        ENDCASE.
    L_IGS_IMGCONV->INPUT  = G_IMG_TYPE.
        L_IGS_IMGCONV->OUTPUT = 'image/x-ms-bmp'.
    *    PERFORM GET_SIZE USING PICTURE_CONTAINER
    * L_IGS_IMGCONV->WIDTH
    * L_IGS_IMGCONV->HEIGHT.
        CALL METHOD L_IGS_IMGCONV->EXECUTE
          EXCEPTIONS
            OTHERS = 1.
        IF SY-SUBRC IS INITIAL.
          CALL METHOD L_IGS_IMGCONV->GET_IMAGE
            IMPORTING
              BLOB      = L_IMG_BLOB
              BLOB_SIZE = L_IMG_SIZE
              BLOB_TYPE = L_IMG_TYPE.
          SPLIT L_IMG_TYPE AT '/' INTO L_IMG_TYPE L_IMG_SUBTYPE.
        ELSE.
          CALL METHOD L_IGS_IMGCONV->GET_ERROR
            IMPORTING
              NUMBER  = L_ERR_CODE
              MESSAGE = L_ERR_TEXT.
          BREAK-POINT.
        ENDIF.
      ENDIF.
    ENDIF.
    So could you please some one help me how to convert JPEG Photo to BMP programatically.
    Regards,
    Mayur.

    johnandersonpalmdesert wrote:
    My printer is requesting a vector file.
    Jpeg File format does not support vectors.  Photoshop has limited vector support and tools.  Photoshop can not save vector file formats like SVG.  What File type does your printer want?
    Adobe Illustrator is Adobe vector application.

  • How to convert jpg to pat for patterns?

    I just downloaded some patterns but they are all jpg and I need to convert them to pat. can anyone help? I have pse 10

    johnandersonpalmdesert wrote:
    My printer is requesting a vector file.
    Jpeg File format does not support vectors.  Photoshop has limited vector support and tools.  Photoshop can not save vector file formats like SVG.  What File type does your printer want?
    Adobe Illustrator is Adobe vector application.

  • How to batch convert jpgs to pdfs?

    I am trying to figure out how to convert a bunch of jpg images to a single pdf file.  I know there are some 3rd party programs that will do this but I was wondering if it is possible to do right inside Adobe Acrobat.  I am running Adobe Acrobat 5.0.  Thank you for any help.

    That's an old version so I don't remember if it has this option but you "should" be able to go to File>Create PDF>From multiple files. Again, your version is old so it may not be there. It's available in the newer versions.

  • How to convert mime file to JPG

    Can anyone tell me how to convert mime-attachments to JPG files?
    Photos that I take on my cell phone and that I send to my e-mail address show as photos when I receive them but the file is converted from a JPG file (in the phone) to a mime-attachment when it arrives in Mail. If I forward the e-mail from my Mac to another e-mail address, the recipients can't open the attachment so they can't see the photo. I can't convert the file to JPG again because no programs I have seem to recognize the mime-attachment file and none will open it.
    Help! Thanks.

    I think I answered my own question. After checking out several sites with various information about MIME attachments, I added .jpg to the file and it opened. Soon I should find out if the newly renamed file can be read in the e-mails I send.

  • How to convert pdf , psd files to jpg or png

    Hi All,
    how to  convert PDF, Ai, EPS, CDR, PSD,BMP, GIF, TIF, TIFF to jpg or png image format

    Acrobat or any otehr tool does not have any automatic translation. You will have to convert your PDF to an editable formatz like a Word document and translate and clean it up there, then export it back as a PDF.
    Mylenium

  • How to convert wbz to jpg

    Hi-Does anyone know how to convert wbz webshots photos to jpg or something iPhoto can view?
    Thanks

    http://holocore.com/?Webshots
    Google is your friend
    Regards
    TD

  • How to convert nikon files to jpg

    how to convert nikon files to jpg

    To see Specs for ViewNX 2:
    http://imaging.nikon.com/lineup/software/viewnx2/spec.htm
    To Download, if it looks like it may work for you:
    http://nikonimglib.com/nvnx/
    {says "free download" but don't know if there's a catch}
    For more information about the Download, specs, and details
    for Macintosh see english North/South American download page:
    http://nikonimglib.com/nvnx/index_en_nsa.html#os-macintosh
    PS: if you get that, and find it crashes, see threads such as this:
    Nikon Capture NX2 crashes when opening image
    {thought the original poster could read all contents here... if not, sorry}
    Good luck!
    edited

  • How to convert RAW images to JPG in Imagebrowser EX 1.4.0.5

    I installed ImagBrowser EX so I can view my raw images.  It works fine for viewing but I can't find how to convert them to raw images.  The manual and help file says to go to Edit > Process RAW Images but when I go to the edit menu, there is no such option.  There is only Correct red-eye, auto correct, adjust color and brightness, increase sharpness, crop imae, insert text, edit movies and extract multiple images from movie
    Help?

    You need to install Canon Digital Photo Professional from the camera-supplied CD.
    John Hoffman
    Conway, NH
    1D Mark IV, Rebel T5i, Pixma PRO-100, MX472

  • Video Format Total Solution: How to Convert and Edit Video on Windows/Mac

    More and More video formats are coming out with different video encoders and it makes our spare time more and more colorful. However, it is not to say that there is no problems. Actually, different video formats make it difficult to share video with others, even your own camcorder and iPod. Is there an easy way to convert videos effectively. Yes, there is.
    In this article, I will show you guys how to convert videos on windows and mac.
    Part 1. How to Convert and Edit Videos on Windows
    For Windows users, you need a Video Converter(http://www.aiseesoft.com/total-video-converter.html) to do that for you.
    Here I use Aiseesoft Total Video Converter(http://www.aiseesoft.com/total-video-converter.html)
    Step 1: Download and install Aiseesoft Total Video Converter
    After you download it to your computer, double click it and it is really easy to install.
    You just need to click “next” and it will complete it in seconds. It will automatically run after installation.
    http://www.aiseesoft.com/images/guide/total-video-converter/screen.jpg
    Step 2: Load Video
    Click “Add File” to find the video that you want to convert and click “open”. It will be loaded automatically.
    Step 3: Select the target to decode
    In the “Profile” drop download list you can find your target according the usage of your output video, such as if you want to put the video on your iPod touch, you can select the “iPod” in the first list and “iPod touch 2 MPEG-4 640*480(*.mp4)” in the second list.
    Step 4: Set Advanced Parameters
    After you select the right output profile, you can click “setting” button to set your advanced parameters. You can adjust video and audio settings separately. In video section, you can change “video encoder”, “resolution”, “frame rate”, “video bitrate”In audio section, you can change “audio encoder”, “sample rate”, “channel”, “audio bitrate”If you want to save this profile and settings and use it next time you can click “save as” button to give a name to it. And the next time you want to use it you can find it in the profile list named “user defined”.
    Step 5: Choose a Destination
    To browse and find a output folder for your output files or just the default one.
    Finally, Click “Convert” button to begin your conversion, here in the converting
    interface you can choose “shut down the computer when conversion complete” or “open output folder when conversion complete” or you just do not choose neither one.
    Tips: How to Edit the Output Video
    This video converter is also a video editor, you can use it to edit your output video as follows:
    http://www.aiseesoft.com/images/guide/total-video-converter/effect.jpg
    1. Effect:
    You are allowed to adjust the “Brightness”, “Contrast”, “Saturation” and you can choose the “deinterlacing” to make the video more enjoyable.
    2. Trim:
    In “Trim” section you can pick up any part of the video to convert.
    There are two ways to select the part of the video you want. One is set the start and end time in the box. The other one is to drag the start and end button in the processing bar.
    3. Crop:
    This function allows you to choose a certain play area to convert. That means you can choose a part of the screen you like to convert. For example, you just like the tv in the middle of the screen, then you can drag the frame around the preview window to select the tv and the output preview will show you the output video.In this section you can also choose the “zoom mode”, such as “keep original”, “full screen”, “16:9”, “4:3”.
    4. Watermark
    In the section, you can add a watermark on the output video to show people something, such as your name, website, studio name or other things. The watermark could be words and picture. You can adjust the transparent of the watermark easily to make it more beautiful.
    Part 2. How to Convert Video on Mac
    This time you need a Video Converter for Mac(http://www.aiseesoft.com/video-converter-for-mac.html)
    Step 1: Add File
    Click “Add File” button to load the video you want to converter
    http://www.aiseesoft.com/images/guide/mac-video-converter/steps.jpg
    Step 2: Choose profile and adjust settings
    You can find your output video format from a drop-list called “Profile”You can also adjust the specific settings of the output video, such as “Resolution”, “Bitrate”, “Encoder” and so on.

    @ Tamwini
    Your only goal is to sell software.
    ‡Thank you for hitting the Blue/Green Star button‡
    N8-00 RM 596 V:111.030.0609; E71-1(05) RM 346 V: 500.21.009

  • How to reduce jpg file size, not pixel dimensions?

    I am preparing images for the web and I really have 2 questions: one about gifs, and one about jpgs.
    My standard procedure is to reduce the image to the desired pixel dimensions at 600 dpi
    That gives me a crisp small image. then I either use it as is if the file size is low enough (I try for under 600 kb) or convert it to a gif with the save for web and devices tool.
    So here are my 2 questions (I will count this solved with either answer)
    1) When I convert to a gif I have the 4 boxes: one with original size, the other 3 with options but often the options are too low res for me How do I change my 3 options to start at a higher gif res?
    2) If I try to reduce the file size of the jpg in the image size box I set the resolution lower ( 400, 300), which lowers the pixel dimensions and the filesize, but I don't want to cahnge the pixel dimensions. And  If I reset the pixel dimensions back to the size I want them, even though it is a lower resolution the file size doesn't change. How to reduce jpg file size using only the resolution, not pixel dimensions?  PS I have tried messing with checking and unchecking the 3 little boxes( scale styles, constrain proportions, and resample) but nothing has worked.

    Gif is not a great filetype, especially if you want a crisp image. What are your pixel dimensions?
    For web, it makes no difference what the dpi is, only the final pixel dimensions so once you have that as you want, use 'Save for Web and Devices' and you can lower the quality - 100% being max and 0% being lowest. I wouldn't save anything below 55%. For a 600kb image, your dimensions must be rather big.

  • How to get jpg photo into photoshop as jpg wt LR changes

    I can not determine how to get jpg photos from Lightroom into Photoshop CS3 without using the export function. With a raw photo I can simply press "clrl e" and the raw photo is converted into a tif or psd file and sent to photoshop. That is very convenient when you have worked on the photo and wish to make additional adjustments in CS3. When I do the same process with a jpg file, it converts the file from jpg into a tif at a much larger file size then necessary. Is there a way to get a jpg file which I have worked on within Lightroom into CS3 without using the export function? Thanks, Arthur

    Lee Jay, I think you are wrong this time (only)!
    Arthur, to solve your problem you have to do two things:
    1. In LR open preferences and activate to automatically write changes to XMP. This ensures that your JPG pictures are updated with the LR settings in the XMP container within the jpg file.
    2.in PSCS3 open preferences. In the file handling section you will find the option to 'prefer Adobe Camera Raw for JPEG files'. If this option is activated also jpg files are processed with ACR.
    You asked for a way to get a jpg file into CS3 without using export. Now you have that. After you made your adjustments in LR just open the jpg in CS3 and you will see the photo with all changes you have made. I tested this with LR and CS3 beta myself it it works perfectly.

  • Converting jpgs to pdf, combine and upload

    I want to convert about 90 JPGs into PDFs, combine them into a single PDF and then upload them. Would welcome some basic advice. I know about PDFLab but not sure how to convert them into PDFs first.
    Many thanks,
    Michael, London

    You can do that easily with Apple's Preview program.
    Open one of the .jpg files in Preview. Click the "Sidebar" button in the toolbar to show the sidebar. Drag all the other .jpgs into the sidebar. Drag them into the order you want. Select them all in the sidebar, select File -> Print, click the PDF button, and choose Save As PDF.

Maybe you are looking for

  • Doubt regarding switchover from logical standby to primary

    I am using Oracle 10g databases on Linux environment I was trying creating a data guard configuration and once I was successfully done I created a logical standby database from the physical standby . Then I was trying to do a switchover . By mistake

  • I cannot open my photoshop elements 10. I get an error 400.

    I cannot open my photoshop elements 10 to edit pictures. I get a message saying that it cannot connect, error 400. I was using it last week no problem than I shut down my computer & tried to open photoshop the next day & the program wouldn't open. I'

  • Weird errors at compile

    Hi, I am new to the Flex technology so I followed the tutorials on the Flex website. When I compile the basic script, i.e http://www.adobe.com/devnet/flex/quickstart/coding_with_mxml_and_actionscript/ tutorial, I get a lot of errors: D:\STARLab\Flex\

  • How to back up a FAT32 Drive with Time Machine?

    I recently bought a 3TB backup drive which I formatted to Mac OS Extended. As expected, Time Machine is able to back up my internal hard drive to this external drive, but I would also like to back up my other 2TB external hard drive (about 300gb full

  • Mail.app opens behind frontmost window.

    Whenever I launch Mail.app, it opens up behind the frontmost application window, whatever that application happens to be. For example, if I launch Mail by clicking the app in the Finder, Mail opens behind the frontmost Finder window. I'm not sure if