Convert BMP, JPEG, GIF to WBMP

I've searched the forum abt this topic but i could not find concrete answers. Pls do tell me how to convert bmp, jpeg and gif to wbmp format. Sample codes would be very helpful. Thanks a lot!!

what the hell is WBMP....i have actually converted a Image File into a Base64 format but never hears of WBMP format
Cheers,
Manja

Similar Messages

  • How to convert a jpeg file into a 1-bit bmp file (2 colors image)

    Hi. I�m having serious problems to convert a jpeg file into a 1-bit bmp file (2 colors image).
    I�m using FileSaver.saveAsBmp(String t) but what i get is a bmp image, but with 16M colors, but what i want is a 2 colors bmp file. A black and white image.
    Does anybody know how to do this? I�m really getting crazy with ths problem.
    Thanks in advance

    Hi opalo,
    this code may help you...
    import java.awt.*;
    import java.io.*;
    import java.awt.image.*;
    import javax.imageio.ImageIO;
    class Write1 extends Component {
    //--- Private constants
    private final static int BITMAPFILEHEADER_SIZE = 14;
    private final static int BITMAPINFOHEADER_SIZE = 40;
    //--- Private variable declaration
    //--- Bitmap file header
    private byte bitmapFileHeader [] = new byte [14];
    private byte bfType [] = {'B', 'M'};
    private int bfSize = 0;
    private int bfReserved1 = 0;
    private int bfReserved2 = 0;
    private int bfOffBits = BITMAPFILEHEADER_SIZE + BITMAPINFOHEADER_SIZE;
    //--- Bitmap info header
    private byte bitmapInfoHeader [] = new byte [40];
    private int biSize = BITMAPINFOHEADER_SIZE;
    private int biWidth = 50;
    private int biHeight = 70;
    private int biPlanes = 1;
    //private int biBitCount = 24;
    private int biBitCount = 1;
    private int biCompression = 0;
    private int biSizeImage = 0x030000;
    private int biXPelsPerMeter = 0x0;
    private int biYPelsPerMeter = 0x0;
    private int biClrUsed = 0;
    private int biClrImportant = 0;
    //--- Bitmap raw data
    private int bitmap [];
    //--- File section
    private FileOutputStream fo;
    //--- Default constructor
    public Write1() {
    public void saveBitmap (String parFilename, Image parImage, int
    parWidth, int parHeight) {
    try {
    fo = new FileOutputStream (parFilename);
    save (parImage, parWidth, parHeight);
    fo.close ();
    catch (Exception saveEx) {
    saveEx.printStackTrace ();
    * The saveMethod is the main method of the process. This method
    * will call the convertImage method to convert the memory image to
    * a byte array; method writeBitmapFileHeader creates and writes
    * the bitmap file header; writeBitmapInfoHeader creates the
    * information header; and writeBitmap writes the image.
    private void save (Image parImage, int parWidth, int parHeight) {
    try {
    convertImage (parImage, parWidth, parHeight);
    writeBitmapFileHeader ();
    writeBitmapInfoHeader ();
    writeBitmap ();
    catch (Exception saveEx) {
    saveEx.printStackTrace ();
    * convertImage converts the memory image to the bitmap format (BRG).
    * It also computes some information for the bitmap info header.
    private boolean convertImage (Image parImage, int parWidth, int parHeight) {
    int pad;
    bitmap = new int [parWidth * parHeight];
    PixelGrabber pg = new PixelGrabber (parImage, 0, 0, parWidth, parHeight,
    bitmap, 0, parWidth);
    try {
    pg.grabPixels ();
    catch (InterruptedException e) {
    e.printStackTrace ();
    return (false);
    pad = (4 - ((parWidth * 3) % 4)) * parHeight;
    biSizeImage = ((parWidth * parHeight) * 3) + pad;
    bfSize = biSizeImage + BITMAPFILEHEADER_SIZE +
    BITMAPINFOHEADER_SIZE;
    biWidth = parWidth;
    biHeight = parHeight;
    return (true);
    * writeBitmap converts the image returned from the pixel grabber to
    * the format required. Remember: scan lines are inverted in
    * a bitmap file!
    * Each scan line must be padded to an even 4-byte boundary.
    private void writeBitmap () {
    int size;
    int value;
    int j;
    int i;
    int rowCount;
    int rowIndex;
    int lastRowIndex;
    int pad;
    int padCount;
    byte rgb [] = new byte [3];
    size = (biWidth * biHeight) - 1;
    pad = 4 - ((biWidth * 3) % 4);
    if (pad == 4) // <==== Bug correction
    pad = 0; // <==== Bug correction
    rowCount = 1;
    padCount = 0;
    rowIndex = size - biWidth;
    lastRowIndex = rowIndex;
    try {
    for (j = 0; j < size; j++) {
    value = bitmap [rowIndex];
    rgb [0] = (byte) (value & 0xFF);
    rgb [1] = (byte) ((value >> 8) & 0xFF);
    rgb [2] = (byte) ((value >> 16) & 0xFF);
    fo.write (rgb);
    if (rowCount == biWidth) {
    padCount += pad;
    for (i = 1; i <= pad; i++) {
    fo.write (0x00);
    int b = 1200;
    fo.write(b);
    rowCount = 1;
    rowIndex = lastRowIndex - biWidth;
    lastRowIndex = rowIndex;
    else
    rowCount++;
    rowIndex++;
    //--- Update the size of the file
    bfSize += padCount - pad;
    biSizeImage += padCount - pad;
    catch (Exception wb) {
    wb.printStackTrace ();
    * writeBitmapFileHeader writes the bitmap file header to the file.
    private void writeBitmapFileHeader () {
    try {
    fo.write (bfType);
    fo.write (intToDWord (bfSize));
    fo.write (intToWord (bfReserved1));
    fo.write (intToWord (bfReserved2));
    fo.write (intToDWord (bfOffBits));
    catch (Exception wbfh) {
    wbfh.printStackTrace ();
    * writeBitmapInfoHeader writes the bitmap information header
    * to the file.
    private void writeBitmapInfoHeader () {
    try {
    fo.write (intToDWord (biSize));
    fo.write (intToDWord (biWidth));
    fo.write (intToDWord (biHeight));
    fo.write (intToWord (biPlanes));
    fo.write (intToWord (biBitCount));
    fo.write (intToDWord (biCompression));
    fo.write (intToDWord (biSizeImage));
    fo.write (intToDWord (biXPelsPerMeter));
    fo.write (intToDWord (biYPelsPerMeter));
    fo.write (intToDWord (biClrUsed));
    fo.write (intToDWord (biClrImportant));
    // DataOutputStream temp = new DataOutputStream(fo);
    // int m = 32;
    // temp.writeInt(m);
    catch (Exception wbih) {
    wbih.printStackTrace ();
    * intToWord converts an int to a word, where the return
    * value is stored in a 2-byte array.
    private byte [] intToWord (int parValue) {
    byte retValue [] = new byte [2];
    retValue [0] = (byte) (parValue & 0x00FF);
    retValue [1] = (byte) ((parValue >> 8) & 0x00FF);
    return (retValue);
    * intToDWord converts an int to a double word, where the return
    * value is stored in a 4-byte array.
    private byte [] intToDWord (int parValue) {
    byte retValue [] = new byte [4];
    retValue [0] = (byte) (parValue & 0x00FF);
    retValue [1] = (byte) ((parValue >> 8) & 0x000000FF);
    retValue [2] = (byte) ((parValue >> 16) & 0x000000FF);
    retValue [3] = (byte) ((parValue >> 24) & 0x000000FF);
    return (retValue);
    class Writebmp
         public static void main(String args[])
              //Image img = Toolkit.getDefaultToolkit().getImage("jatin.bmp");
              try
              File filename = new File("jatin_test.bmp");
              BufferedImage image = ImageIO.read(filename);
              Graphics graphics = image.getGraphics();
              graphics.drawString("&#2313;&#2332;&#2327;&#2352;",10,30);
              Write1 w = new Write1();
              Image img = Toolkit.getDefaultToolkit().getImage("jatin_test.bmp");
              w.saveBitmap("jatin_test.bmp",img,200,200);
              catch (IOException e)
    System.err.println ("Unable to write to file");
    System.exit(-1);
    }

  • Dynamically convert swf to jpeg/gif format

    hello,
    I need a help to dynamically convert swf to jpeg/gif format
    using java/jsp
    this feature is implemented in php in the below URL
    http://www.sephiroth.it/tutorials/flashPHP/print_screen/index.php
    Thanks and regards
    Namratha

    You need to go here:
    Screen
    Cap Using Flash 8 and PHP
    It is exactly what you need.
    Walter
    And you can kiss the ground and thank God above that I was
    able to point you to this, it took me months to find!!!

  • Convert a jpeg file into a 1-bit bmp file (2 colors image).

    Hi. I�m having serious problems to convert a jpeg file into a 1-bit bmp file (2 colors image).
    First, i,ve tried to get a 1-bit jpeg. But i think this is not possible, so what i have to do is to get a 1-bit bpm file.
    I�m using FileSaver.saveAsBmp(String destination) and what i get is a bmp image, but with 16M colors, but what i want is a 2 colors bmp file. A black and white image.
    Does anybody know how to do this? I�m really getting crazy with ths problem.
    Thanks in advance

    You better read this at
    http://forum.java.sun.com/thread.jspa?forumID=57&threadID=733738

  • Convert jpeg, gif, etc. to DST format

    on a hunt for a program that will convert jpeg, gif, etc. to DST format.  Looking to do some embroidering, and not break the bank.

    Not possible. CAD files aren't simple graphics.
    Also, there doesn't appear be any Mac supported application which will open embroidery files.

  • How do I convert a JPEG file to an Adobe Reader (PDF) file?

    Please help me. I have scanned an image of a text in a book.  The scanned image is automatically uploaded into a JPEG file.  How do I convert this into a PDF file?

    None of the free Adobe Reader products provide the capability of converting image files (e.g. jpeg, gif, png) to PDF.
    You can either use
    Acrobat XI Pro or Standard - Scan to PDF
    Adobe PDF Pack (formerly known as CreatePDF): online subscription service - JPEG to PDF Converter
    You may find some free non-Adobe apps or online services.  But the quality of PDF output may vary.
    Unless you use OCR (Optical Character Recognition), the scanned image of text will not be recognized as real text.  So you will not be able to highlight text, for example.

  • IGS COnverted BMP Image upload problem in SE78

    HI Friends,
    I Converted the JPEG image into BMP ormat by using IGS. It is converting properly. i am able to see the BMP image. When i am trying to upload it through the SE78 i am getting the short dump.
    If convert it manually, i am able to upload the image. i did not get the any difference between these two including file size, width and height.
    I attached the shortdump and converted image file as an attachment. Can anyone give me inputs where i am missing the target.
    Runtime error : COMPUTE_INT_TIMES_OVERFLOW
    Exception : CX_SY_ARITHMETIC_OVERFLOW
    Thanks ,
    Srinivas Bhavanam

    Hi Oisin,
    Sorry for the Late Reply. I am using IGS 6.40 with solaris system.
    If i am converting the image from my desktop i am getting 96DPI resolution. Where as if i am doing it from IGS i am getting 30682172 DPI resolution.
    I am using SAP 4.7. Is it the latest patch level or latest IGS supported.
    Short Dump :
    Runtime Error          COMPUTE_INT_TIMES_OVERFLOW
    Exception              CX_SY_ARITHMETIC_OVERFLOW
           Occurred on     03.03.2010 at   11:04:30
    Whole number overflow on multiplication.
    What happened?
    Error in ABAP application program.
    The current ABAP program "SAPLSTXBITMAPS" had to be terminated because one of
    the
    statements could not be executed.
    This is probably due to an error in the ABAP program.
    What can you do?
    Print out the error message (using the "Print" function)
    and make a note of the actions and input that caused the
    error.
    To resolve the problem, contact your SAP system administrator.
    You can use transaction ST22 (ABAP Dump Analysis) to view and administer
    termination messages, especially those beyond their normal deletion
    date.
    Error analysis
    An exception occurred. This exception is dealt with in more detail below
    . The exception, which is assigned to the class 'CX_SY_ARITHMETIC_OVERFLOW',
    was neither
    caught nor passed along using a RAISING clause, in the procedure
    "FILL_BMFILE_FROM_BMP" "(FORM)"
    Since the caller of the procedure could not have expected this exception
    to occur, the running program was terminated.
    The reason for the exception is:
    In the current program "SAPLSTXBITMAPS", multiplying the numbers 1207959552 and
    100 (using the operation * or 'MULTIPLY') resulted in a value
    greater than 2147483647 or smaller than -2147483648. This
    results in a whole number overflow.
    How to correct the error
    The exception must either be prevented, caught within the procedure
    "FILL_BMFILE_FROM_BMP"
    "(FORM)", or declared in the procedure's RAISING clause.
    To prevent the exception, note the following:
    You may be able to split the process into separate components, so that
    the values generated are smaller.
    If the error occurred in one of your own programs or in an SAP program
    that you modified, try to correct it yourself.
    If you cannot solve the problem yourself, please send the
    following documents to SAP:
    1. A hard copy print describing the problem.
       To obtain this, select the "Print" function on the current screen.
    2. A suitable hardcopy prinout of the system log.
       To obtain this, call the system log with Transaction SM21
       and select the "Print" function to print out the relevant
       part.
    3. If the programs are your own programs or modified SAP programs,
       supply the source code.
       To do this, you can either use the "PRINT" command in the editor or
       print the programs using the report RSINCL00.
    4. Details regarding the conditions under which the error occurred
       or which actions and input led to the error.
    System environment
    SAP Release.............. "620"
    Application server....... "EWR0R3DEV002"
    Network address.......... "10.20.32.13"
    Operating system......... "SunOS"
    Release.................. "5.9"
    Hardware type............ "sun4u"
    Character length......... 16 Bits
    Pointer length........... 64 Bits
    Work process number...... 0
    Short dump setting....... "full"
    Database server.......... "EWR0R3DEV002"
    Database type............ "ORACLE"
    Database name............ "I07"
    Database owner........... "SAPRGG"
    Character set............ "C"
    SAP kernel............... "640"
    Created on............... "Mar 9 2009 21:04:19"
    Created in............... "SunOS 5.8 Generic_117350-38 sun4u"
    Database version......... "OCI_920 "
    Patch level.............. "274"
    Patch text............... " "
    Supported environment....
    Database................. "ORACLE 9.2.0.., ORACLE 10.1.0.., ORACLE
    10.2.0.."
    SAP database version..... "640"
    Operating system......... "SunOS 5.8, SunOS 5.9, SunOS 5.10"
    User, transaction...
    Client.............. 999
    User................ "SREDDY"
    Language key........ "E"
    Transaction......... "SE78 "
    Program............. "SAPLSTXBITMAPS"
    Screen.............. "SAPLSTXBITMAPS 4001"
    Screen line......... 8
    Information on where terminated
    The termination occurred in the ABAP program "SAPLSTXBITMAPS" in
    "FILL_BMFILE_FROM_BMP".
    The main program was "SAPMSSCH ".
    The termination occurred in line 1959 of the source code of the (Include)
    program "LSTXBITMAPSF03"
    of the source code of program "LSTXBITMAPSF03" (when calling the editor 19590).
    Processing was terminated because the exception "CX_SY_ARITHMETIC_OVERFLOW"
    occurred in the
    procedure "FILL_BMFILE_FROM_BMP" "(FORM)" but was not handled locally, not
    declared in the
    RAISING clause of the procedure.
    The procedure is in the program "SAPLSTXBITMAPS ". Its source code starts in
    line 1843
    of the (Include) program "LSTXBITMAPSF03 ".
    Source code extract
    019290     endcase.
    019300   * compression
    019310     perform bmptab_getdword_ofs tables bitmap_file
    019320                                 using  ofs bmp_compression.
    019330     case bmp_compression.
    019340       when c_bmp_compr_rgb.              "BI_RGB, uncompressed
    019350       when c_bmp_compr_rle8. "BI_RLE8, 256 colors colormap, rle encoding
    019360       when c_bmp_compr_rle4. "BI_RLE8, 16 colors colormap, rle encoding
    019370       when others. message e872 raising bmperr_unsup_compression.
    019380     endcase.
    019390   * size of image
    019400     perform bmptab_getdword_ofs tables bitmap_file
    019410                                 using  ofs bmp_sizeimage.
    019420   * pix per meter X
    019430     perform bmptab_getlong_ofs tables bitmap_file
    019440                             using ofs bmp_xpelspermeter.
    019450   * pix per meter Y
    019460     perform bmptab_getlong_ofs tables bitmap_file
    019470                             using ofs bmp_ypelspermeter.
    019480   * colors used
    019490     perform bmptab_getdword_ofs tables bitmap_file
    019500                                 using  ofs word.
    019510   * colors important
    019520     perform bmptab_getdword_ofs tables bitmap_file
    019530                                 using  ofs word.
    019540     ofs_rgbquad = ofs_bitmapinfoheader + bmp_bisize.
    019550   * now we have OFS_RGBQUAD    -> color table
    019560   *             OFS_BITMAPDATA -> bitmap bytes
    019570     otf_bminfo-new_rd_format = c_false.
    019580     otf_bminfo-is_resident   = c_false.
    >     otf_bminfo-dpi = ( bmp_xpelspermeter * 100 ) / 3937.
    019600     perform bmp_adjust_dpi using otf_bminfo-dpi.
    019610     otf_bminfo-w_pix = bmp_width.
    019620     otf_bminfo-h_pix = abs( bmp_height ).
    019630     otf_bminfo-w_tw = ( 1440 * otf_bminfo-w_pix ) / otf_bminfo-dpi.
    019640     otf_bminfo-h_tw = ( 1440 * otf_bminfo-h_pix ) / otf_bminfo-dpi.
    019650     case bmp_bitcount.
    019660       when 1.
    019670         otf_bminfo-bitsperpix = 1.
    019680         otf_bminfo-bytes_per_row = otf_bminfo-w_pix div 8.
    019690         rest = otf_bminfo-w_pix mod 8.
    019700       when 4.
    019710         otf_bminfo-bitsperpix = 4.
    019720         otf_bminfo-bytes_per_row = otf_bminfo-w_pix div 2.
    019730         rest = otf_bminfo-w_pix mod 2.
    019740       when 8.
    019750         otf_bminfo-bitsperpix = 8.
    019760         otf_bminfo-bytes_per_row = otf_bminfo-w_pix.
    019770         rest = 0.
    019780       when 24.
    Thanks & Regards,
    Srinivas Bhavanam

  • JPEG/GIF image to BASE64

    Hi,
    I like to convert JPEG/GIF or any type of image into BASE64 format and Viceversa. Can somebody provide me the java code for doing this.
    Cheers,
    Siva Maranani.

    Rather than use an undocumented API, I would suggest a 3rd party library for Base64 encoding such as the one that I wrote:
    http://ostermiller.org/utils/Base64.html
    It even has several convenience methods for encoding files:
    static void      encode(File fIn)
    Encode this file in Base64.
    static void      encode(File fIn, boolean lineBreaks)
    Encode this file in Base64.
    static void      encode(File fIn, File fOut)
    Encode this file in Base64.
    static void      encode(File fIn, File fOut, boolean lineBreaks)
    Encode this file in Base64.

  • Need help to create report with jpeg/gif image

    Hello,
    I need help with creating a form with a special jpeg/gif seal. I never done this Java. Until now, I created all forms with ansi C++ with HP escape characters to draw lines, boxs, and text. This form will contain boxes which is populated with database information read from a text file.
    Since this form contains a special seal on the upper right, I don't think it can be done with old fashion ansi C++. How can I create a form with Java and create it as a simple exe to just print the form to a specified printer.
    Thanks,
    John

    Hi,
    I am creating a form with boxes (lines and text). What is special about this form is that it has an image jpeg or gif at the top right corner. Is is a state department seal. Up to this form, I had used ansi C++ and print out escape HP character to print out the lines, boxes, and text. I have no idea how to print out the image. I am new to JAVA and only 1 class in it. Is there sample code out there to create this type of form with the image? I need a starting point.
    Thanks,
    John

  • I would like to convert an animated Gif to .mov, will Quicktime Pro 7 do this? Should I spend the money?

    Hi everyone.
    I'm looking to put a few animations onto keynote and I'm making my presentation on PowerPoint.
    I need to convert an animated gif into a .mov file and was wondering whether Quicktime Pro 7 does this?
    Thanks

    I need to convert an animated gif into a .mov file and was wondering whether Quicktime Pro 7 does this?
    Since it appears QTKirk has provided the best answer for your specific work flow issue as stated, I will answer your more general question...
    Yes, QT 7 Pro can open an animated GIF file and save it as an MOV file. At this time the real question is whether or not the MOV file produced is suitable for your needs. Basically the MOV file can be then then be played—but it only plays one pass in the normal playback mode. You can, of course opt to loop the playback which, for a small files, plays much as the original GIF.
    Unfortunately, the "Loop" setting is not saved when the MOV file is saved, so this option must be re-initialized each time the MOV file is opened. This would not be a problem if all you are doing is openening the file in the QT 7 player and letting it play in the looped mode all day as some sort of display but would likely be an unsatisfoactory solution for sending the MOV file to someone else. You could, of course, turn the MOV file into a QTL file with the loop option set to get around this problem.
    While I would be hard pressed to say it would be a good investment just for the creation of GIF movie files, QT 7 Pro does offer a lot of other features that make it a bargain utility for many quick edit requirements if you use/need them.

  • How can I keep my RAW photo files from converting to JPEG???

    How can I keep my RAW photo files from converting to JPEG???

    Hello briggiebunny
    If iTunes can read the movie files, then you will need to create an iPad version by going to the drop down menu File > Create New Version > Create iPad or Apple TV Version and then syncing that newly created file.
    iTunes: Videos may be unable to sync to iPhone, iPad, or iPod
    http://support.apple.com/kb/ts1497
    Regards,
    -Norm G.

  • Photoshop CC Can't convert to jpegs; image processor not opening

    I'm on Windows 7. When I open a psd document in PS CC, I don't have the option to convert to jpeg, and a lot of other types, for that matter. Also, when I click on Tools/Photoshop/Image processor it will not open up. Any suggestions? Thank you.

    It was already disabled when I checked. I enabled it and tried again, still didn't work. Anything else that might be wrong? i'm getting desperate lol

  • How do I convert a jpeg file into a pdf file?

    I would like to be able to convert a jpeg file, both in Photoshop and outside of Photoshop, into a pdf file.  How do I go about doing that?

    If you don't have Acrobat, you'll need to do it in Photoshop. File>Save as>Photoshop PDF. If it is a cmyk file, you'll need to convert it to rgb first.

  • How do you convert a jpeg file into word document so i can edit it?

    How do you convert a jpeg file into word document so i can edit it?

    http://office.microsoft.com/en-us/mac-word-help/training-edit-pictures-in-office -for-mac-2011-RZ103709558.aspx

  • How do I convert a Jpeg file to a PDF file

    How do I convert a jpeg file to a pdf file?

    Hi Rick
    With a paid subscription to Adobe CreatePDF you can covert a jpeg to PDF
    See https://www.acrobat.com/createpdf/en/home.html for further information and pricing plans

Maybe you are looking for

  • The project could not be prepared for publishing ... error (-49)

    Can somebody help? iMovie won't export movie in HD 720p. I am getting folowing message: "The project could not be prepared for publishing because an error occured. (-49)" After that I tryed to export "Large" movie (960 x 540) and everything was OK! M

  • Need help in FR Reports Migration which are built on HFM

    Hi, We have all the Hyperion applications [HFM, Shared Services, FR and other BI + Services] on Hyperion 9.3.1.0 and we have to migrate the FR reports that are built in PROD environment to UAT. These FR Reports which are available on PROD are working

  • Xbox 360 to macbook?

    i was wondering if theres a way to use my macbook as a screen to plug my xbox 360 to it will it work? thanks

  • Always install applications into non-global zones?

    I am planning on taking full advantage of Containers and Zones as I migrate servers and applications to Solaris 10. During this migration process, I believe that I will have a need to initially just run just one application on a server. I fear that i

  • Problems with Tutorial... 403 From Browser...

    hi I've done the tutorial from oracle.com "uploading and downloading from your app" Link to the tutorial: http://www.oracle.com/global/de/community/tipps/FileDownload/index.html Every time I try to download one of the uploaded files I get a 403 "you