Converting an image to create a negative

Hi. Relatively new to using Illustrator (approx 12 months) and use it mainly with students for generating files for our lasercutter. Am just wondering how you take an image (or a photo) and create a 'negative' of it. A number of students have images that have a lot of black on them (which would all be cut on the lasercutter) and so am looking at changing this to reduce cutting times. Thanks

Is this really a good idea? Surely it makes no difference in cutting time whether an image is negative or positive. The length of the lines where black meets white are identical.
The amount of black makes no difference either because on a mostly black image most of the black gets left behind, whereas on a mostly white image most of the black gets peeled off and discarded.

Similar Messages

  • How can I convert an image created in Photoshop into a format that Java's ImageIO library will take?

    Hi all,
    I've been trying to write an image resize tool to use the Lancoz resample algorithm to resize images to a high standard in Java.  The library with the algorithm/filter in it is mortennobel's image scaling library and it takes a buffered image as an input and returns the resized image as desired.  However the trouble I’m having is that the ImageIO library in Java, a standard library, which converts images given to its read method to buffered images doesn't accept certain images created in Photoshop and so it throws an exception.  My library needs to be fully automated to process possible thousands of images at a time and so manually converting them by resaving them as JPEG's is really feasibly.  Is there some way I can convert these images from Adobes Exif format to standard JFIF format?  I've tried simple inserting the APP0 marker from a JFIF image in-between the SOI and APP1 marker but the ImageIO library still failed.
    The above image is a screenshot of the binary in hex of one of the images that cause an Invalid Format exception when passed to ImageIO.
    Any help you could offer me with this would be much appreciated.
    Kind regards and thank you,
    Alexei Blue
    Science Warehouse.
    NB: I previously posted this post in Developers but was told to post it in a Photoshop forum so apologies if this is the incorrect formum

    The image scaling library does have a BiCubicFilter in it so I'll experiment around with them and see what happens.  As for the imageIO library I think it accepts Exif image types, but still for some reason it just doesn't like Adobe Photoshop types.  Maybe its the colour map it doesn't like I just can't seem to work out what's wrong which is slightly frustrating but looking round to see if I can find an answer

  • How can I create a negative from image in iPhoto

    I wish to create a negative from an image in iPhoto so I can print as if the negative. Is it possible to do this in iPhoto?

    GraphicConverter, Pixelmator  and Photoshop Elements for Mac all have the invert function.

  • Create a negative image in Appleworks

    I need to turn AppleWorks Drawing documents into negatives. For example, I might have 6 scanned images on one A4 page. These are usually lineart eps images. I need to convert these so the images are white and the backround page is black. I can do this in Photoshop by pressing [Apple + I]. I have tried to save the AppleWorks file as a jpg (and other formats) in AppleWorks and then open them in PhotoShop to invert, but they open up in PhotoShop all jagged.
    It is not practicable to convert the images in Photoshop to white images and past them on to a black background because:
    1. The images cannot be stacked closely together (eps is essentialy so you can have transparent backround, making the images closer together. A transparent white image is no good on top of a black backgorund)
    2. It is harder to adjust the size of the images on a black background because I can't see the grid, which is always black).
    Any ideas? This is an important part of process of making letterpress negatives.
    Intel iMac 20"   Mac OS X (10.4.6)  
    Intel iMac 20"   Mac OS X (10.4.6)  
    Intel iMac 20"   Mac OS X (10.4.6)  

    There is no setting for inverting colours with my HP LaserJet 5MP. I have checked the settings when the print window comes up.
    I have used AppleWorks very successfully for my purpose for around 12 years. I used it to set up a page to lay out rubber stamps for manufacture. Until recently I was printing the images as positives and using photographic film to make a negative, which is used for making rubber stamps. I now can save a lot of time by printing directly onto a new film, which acts as the negative, saving time messing around with chemicals etc. However, to do this I must print the image inverted.
    The advantages of AppleWorks are
    1. It is very simple and quick to start up.
    2. I use eps images in lineart (transparent whites), so I can move different images close to each other, whithout a white corner of an image overlapping [imagine 2 black circles can be placed almost touching each other - if you used a jpg then there would be a large white corner interfering with the image underneath].
    3. I keep the grid set in inch sizes. This way I can easily resize images on the page individually to the grid, without having to keep track of the original scanned images - these can be deleted right away.
    4. It is very easy to move images around to optimize the number that can be packed on a sheet.
    The problem with PhotoShop is
    1. There is no grid, so images have to be sized before pasting into a document.
    2. You will end up with multiple layers, which would be really confusing if I hada lot of designs on one page (I can have up to 100 small designs on one page).
    3. I can copy and paste documents in AppleWorks from one document to another. If I copy an AppleWorks document into PhotoShop it goes really jagged (useless)
    4. The transparent background does not seem to work on pasting into a document.
    In an ideal world I would have
    a) a plugin for AppleWorks to invert the image or
    b) a print option on the printer to invert the image [How do you find out about this before you buy the printer].
    Intel iMac 20" Mac OS X (10.4.6)
    Intel iMac 20" Mac OS X (10.4.6)
    Intel iMac 20" Mac OS X (10.4.6)
    Intel iMac 20" Mac OS X (10.4.6)
    Intel iMac 20" Mac OS X (10.4.6)
    Intel iMac 20" Mac OS X (10.4.6)

  • Need to convert an image to .jpeg using Java !

    Hello,
    i am working in images now. i need to convert any image in the form of .jpeg using Java. in other words, i need to store an image in the form of .jpeg format. can any of u help me ! thanks in advance.
    - Krishna

    There's also jimi, at http://java.sun.com/products/jimi/
    You can do something like:
    image = new BufferedImage (width, height, BufferedImage.TYPE_INT_RGB);
    // create your image
    String path = "/path/image.jpg";
    Jimi.putImage(image, path);
    [\code]                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • How to convert an Image to a byte array?

    I want to make a screenshot and then convert the image to a byte of arrays so I can send it through a BufferedOutputStream.
    try
                   robot = new Robot();
                   screenshot = robot.createScreenCapture(new Rectangle(500,500));
                   imageFile = new File("image.png");
                   ImageInputStream iis = ImageIO.createImageInputStream(screenshot);
                   byte[] data = new byte[1024];
                   byte[] tmp = new byte[0];
                   byte[] myArrayImage = new byte[0];
                   int len = 0;
                   int total = 0;
                   while((len = iis.read(data)) != -1 ) // LINE 52 --- EXCEPTION CATCHED HERE
                        total += len;
                        tmp = myArrayImage;
                        myArrayImage = new byte[total];
                        System.arraycopy(tmp,0,myArrayImage,0,tmp.length);
                        System.arraycopy(data,0,myArrayImage,tmp.length,len);
                   ios.close();I get this exception while running:
    Exception in thread "Thread-0" java.lang.NullPointerException
    at Server.run(Server.java:52)
    at java.lang.Thread.run(Unknown Source)

    Fixed that. I got a new problem.
    When I connect to my simple server application that reads the image file, converts it to an array of bytes and sends it back, the file is created on the client side and it containts data, but I am not able to open the image. I have checked that the image that the server is sending is working. So where is the problem?
    The client application recieves the image as following:
    public void run()
            try
                socket = new Socket("127.0.0.1", 2000);
                BufferedOutputStream out_file = new BufferedOutputStream(new FileOutputStream("recieved_img.png"));
                BufferedReader in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
                int inputLine;
                while((inputLine = in.read()) != -1)
                    char c = (char)inputLine;
                    System.out.println(c);
                    out_file.write(inputLine);
            catch(IOException err){ err.printStackTrace(); }
        }And the server sends the image like this;
    try
              socket = server.accept();
              in=new BufferedReader(new InputStreamReader(socket.getInputStream()));
              out = new BufferedOutputStream(socket.getOutputStream());
              out.write(25);
              while((inputLine = in.readLine()) != null)
                   System.out.println(myArrayImage.length);
              System.out.println(inputLine);
                        out.write(myArrayImage);     // Send the array of bytes
         }

  • To convert multiple image files to pdf using pdfsharp in C#

    Hey guys I have this C# code to convert any image file to .pdf using pdfsharp.dll. But I want to select multiple images for conversion please help. here's my code (plz note enable pdfsharp.dll in the reference)
    usingSystem;
    usingSystem.Collections.Generic;
    usingSystem.Linq;
    usingSystem.Text;
    usingSystem.Threading.Tasks;
    usingPdfSharp.Pdf;
    usingPdfSharp.Drawing;
    usingSystem.IO;
    namespaceConsoleApplication1
    classProgram
    staticvoidMain(string[]
    args)
    PdfDocumentdoc =
    newPdfDocument();
    doc.Pages.Add(newPdfPage());
    XGraphicsxgr =
    XGraphics.FromPdfPage(doc.Pages[0]);
    XImageimg =
    XImage.FromFile(source
    path...);
    xgr.DrawImage(img,0,0);
    doc.Save(destination path...);
    doc.Close();

    try this one
    public string CreatePDF(System.Collections.Generic.List<byte[]> images)
    dynamic PDFGeneratePath = Server.MapPath("../images/pdfimages/");
    dynamic FileName = "attachmentpdf-" + DateTime.Now.Ticks + ".pdf";
    if (images.Count >= 1) {
    Document document = new Document(PageSize.LETTER);
    try {
    // Create pdfimages directory in images folder.
    if ((!Directory.Exists(PDFGeneratePath))) {
    Directory.CreateDirectory(PDFGeneratePath);
    // we create a writer that listens to the document
    // and directs a PDF-stream to a file
    PdfWriter.GetInstance(document, new FileStream(PDFGeneratePath + FileName, FileMode.Create));
    // opens up the document
    document.Open();
    // Add metadata to the document. This information is visible when viewing the
    // Set images in table
    PdfPTable imageTable = new PdfPTable(2);
    imageTable.DefaultCell.Border = Rectangle.NO_BORDER;
    imageTable.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTER;
    for (int ImageIndex = 0; ImageIndex <= images.Count - 1; ImageIndex++) {
    if ((images(ImageIndex) != null) && (images(ImageIndex).Length > 0)) {
    iTextSharp.text.Image pic = iTextSharp.text.Image.GetInstance(SRS.Utility.Utils.ByteArrayToImage(images(ImageIndex)), System.Drawing.Imaging.ImageFormat.Jpeg);
    // Setting image resolution
    if (pic.Height > pic.Width) {
    float percentage = 0f;
    percentage = 400 / pic.Height;
    pic.ScalePercent(percentage * 100);
    } else {
    float percentage = 0f;
    percentage = 240 / pic.Width;
    pic.ScalePercent(percentage * 100);
    pic.Border = iTextSharp.text.Rectangle.BOX;
    pic.BorderColor = iTextSharp.text.BaseColor.BLACK;
    pic.BorderWidth = 3f;
    imageTable.AddCell(pic);
    if (((ImageIndex + 1) % 6 == 0)) {
    document.Add(imageTable);
    document.NewPage();
    imageTable = new PdfPTable(2);
    imageTable.DefaultCell.Border = Rectangle.NO_BORDER;
    imageTable.DefaultCell.HorizontalAlignment = Element.ALIGN_CENTER;
    if ((ImageIndex == (images.Count - 1))) {
    imageTable.AddCell(string.Empty);
    document.Add(imageTable);
    document.NewPage();
    } catch (Exception ex) {
    throw ex;
    } finally {
    // Close the document object
    // Clean up
    document.Close();
    document = null;
    return PDFGeneratePath + FileName;

  • How to convert a image layer to a text layer any idea? a image looks like a text in layers box

    How to convert a image layer to a text layer any idea? a image looks like a text in layers box

    You can't convert an image into a text layer.  What you can do is clip an image to a text layer so that just the image layer shows up where there is text.  Create a text layer, then above it put your image layer.  Hold down the alt/opt key and click between the two layers to clip them.

  • How do i convert an image object to a byte array ?

    Hi
    how do i convert an image object into a byte array
    early reply apperciated

    Oh sorry my method and the other method need to have the pixels from the Image passed to them which you get my using pixelgrabber:
    //create width and height variables from image
              int w = img.getWidth(this);
              int h = img.getHeight(this);
              //retrive picture from image
              int[] pix = new int[w * h];
              PixelGrabber pg = new PixelGrabber(img, 0, 0, w, h, pix, 0, w);
              try{ pg.grabPixels();
              } catch (InterruptedException ioe) {
                   System.err.println("Interrupted");
              if ((pg.getStatus() & ImageObserver.ABORT) != 0) {
              System.err.println("image fetch aborted or errored");
              }

  • How do I convert raw images with side car to Dng and

    How do I convert raw images with side car to Dng and preserve the sidecar info in the DNG?
    I have tons of raws + xmp sidecars that i want to convert to dng, because the raws are from different camera brands and i want to get everything simplified. so that i do not have to worry if I will be able to access the raws in the future, if I decide I want to rework some of the files.
    T.I.A.

    If the images are already in your catalog you can select them then choose Convert Photos to DNG from the Library menu. You'll be given the option of deleting the original raw files. Either way, Lr will only display the newly created DNG files.
    The alternative, which is better suited to images not already in the catalog is to use the Adobe DNG Converter

  • 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

  • How to Convert Bitmap Images into WPF XAML files

    I am tasked with converting about twenty bitmap images into a workable XAML file complete with all of the path statements, line segments, arc segments, etc. Is there a tool out there that take the bitmap image and create an entirely new XAML file?
    Thanks,
    Barton

    Hi,
    maybe:
    http://stevenhollidge.blogspot.de/2012/05/converting-images-to-paths.html
    http://stackoverflow.com/questions/129972/convert-an-image-to-xaml
    http://stackoverflow.com/questions/15082716/can-we-convert-an-image-to-xaml-using-expression-blend
    this is not a trivial task [and maybe beyond the scope of this forum]. If you had some vector image like svg images there might be a control out to use, but with raster images, I dont know of any control or code to use; I *think*, you will have to vectorize
    the image content yourself, which isn't that easy...
    So, is Background and Foreground easily distinguishable? Do shapes overlap? ...
    If there are only some shapes in the image and BG and FG can be separated easily then you could "scan" the image by some chaincode like operation to get the contours/contour vectors and then decide what to do. If there are patterns in BG or FG
    things will become more difficult, you then will have to perform more math-to-image operations and a vector-representation while reading/scanning the image might not be enough (keywords are computer vision, pattern recognition [with multi-linear-forms] etc).
    Maybe an existing computer vision [-able] component loke opencv can help a lot...
    Edit: I just did a google lookup and found eg this:
    http://www.cs.ucla.edu/~dt/theses/vasilescu-thesis.pdf
    I havent read it so far, so I cannot say, if its what you need, but title and a quick view into looks promising/interesting.
    Regards,
      Thorsten

  • How do I open RAW images from DSC_RX100M3?  I downloaded Adobe DNG converter 8.4, but could not convert the images?

    How do I open RAW images from DSC_RX100M3?  I downloaded Adobe DNG converter 8.4, but could not convert the images?

    Small correction to what SSprengel wrote...
    The RX100M3 is supported only by version 8.5.  It sounds like you need a newer version.
    Photoshop Help | Digital Negative (DNG)
    -Noel

  • Converting an Image to a PlanarImage

    I have captured a frame from a video clip as an Image, and want to send this through a series of filters I have programmed.
    These filters use JAI and so take PlanarImages as inputs.
    I therefore wouldlike to convert an Image to a PlanarImage. Any suggests would be much appreciated.
    Also I before I send my Image through the filtering, I want to split the RGB image into 3 gray_scale images (one for each band). I am also struggling with this.
    I can get the A,R,G,B of the image easily enough, but I don't know how to transform these into seperate Images or PlanarImages.
    Cheers,
    Adam

    The following should do it
    Image src = BufferToImage.createImage(WHATEVER);
    RenderedOp result = JAI.create("AWTImage",src);RenderedOp is a PlanarImage and also implements RenderedImage.
    I would split the image into colour bands after you get it into the
    JAI domain. There is a simple operation to do it.
    public RenderedOp getBand(RenderdOp src, int band) {
      int[] bands = new int[1];
      bands[0] = band; // select band
      ParameterBlockJAI param = new ParamterBlockJAI("BandSelect");
      param.addSource(src);
      param.add("bandIndices", bands);
      return JAI.create("BandSelect",param);
    }matfud

  • Convert colour images to grayscale images & get pixel data from them

    Is the code below correct to convert colour images to grayscale images in Java?
    public void convertToGrayscale (String sourceName,String destName) throws Exception {
    JPEGImageDecoder decoder=JPEGCodec.createJPEGDecoder(new FileInputStream(sourceName));
    JPEGImageEncoder encoder=JPEGCodec.createJPEGEncoder(new FileOutputStream(destName));
    BufferedImage sourceImg=decoder.decodeAsBufferedImage();
    BufferedImageOp op =new ColorConvertOp(
              ColorSpace.getInstance(ColorSpace.CS_GRAY),null);
         BufferedImage destImg = op.filter(sourceImg,null);
    encoder.encode(destImg);
    decoder = null;
    encoder = null;
    When I get grayscale images from the code below, I would like to access the pixels of those images. So I tried to do:
    byte[] dd=((DataBufferByte)mImage.getRaster().getDataBuffer()).getData();
    BUT the data result array is not 0-255. Could anyone suggest how to obtain pixel data from grayscale images?
    In case that my code shown is not correct or suitable, please give your advice. What I would like to do are in the steps as follows:
    1 change 100*70 jpeg-images to 100*70 grayscale images.
    2 create two dimensional array of pixel data (example [100][70]) from converted images. The number in the array should be between 0-255, right??? And 0 refers to black colour and 255 refers to white colour???
    I am confused about grayscale images. Please help.
    Thank you so much

    I am not sure i understand what is the problem exactly.
    Structure of DataBuffer is described by SampleModel used by same Raster
    object. E.g. it might be 1 byte per xipex or 4 bytes per pixel.
    In your example convertToGrayscale saves images to file as JPEG and
    it seems you later read it back. It is possible what image you read back
    is not greyscale but ARGB and data buffer has different format.
    Technically, if you just need level of grey you may simply
    call getRGB on your output image. Grey is uniform mix of R, G and B.
    Also, instead of ColorConverOp you may dimply create output image of
    grayscale type and draw your color input image with drawImage().
    If none of these helps please try to provide more details.

Maybe you are looking for

  • File upload component problem

    hi, When i use fileupload component in my page, Turkish characters is not renderind and i see them as question mark. Changing page encoding is not working and solving my problem, too. any suggestion would be appreciated. Regards...

  • Large Hardcover Book

    I just placed an order for a large hardcover book from iPhoto and have recently read that the quality on the medium sized books was mediocre. Is this true for the large hardcover books? Also, how's the quality on the calendars and greeting cards? I'm

  • I dont get it? After calling vzw customer care

    I have a quick queston, i thought the concept through this whole thing was for your cc to get charged when the item is SHIPPED.  My credit card was charged but no tracking number available.  After calling customer care they said it will be shipped on

  • Moved my laptop and now I can't connect to the router

    I'm a novice at this - but that didn't stop me from setting up a wireless network  - it was very easy, everything went fine and was working great for months.  I took the laptop out of the house and used it at another location.  When I brought the lap

  • HT4061 What if your phone is not paired with iTunes?!

    What if your iPhone is not paired with iTunes and you're trying to find it!