Creating 8-bit grey images

i want to create 8bit 256 grey level images using java.awt.image.BufferedImage.what should be the parameter i should use in the constructor to create one?

BufferedImage.TYPE_BYTE_GRAY

Similar Messages

  • Open previously created 32-bit HDR image in HDR Pro

    It seems to me that it would be nice to be able to open previously-created 32-bit HDR files back in HDR Pro. I usually create a number of radiance files, which I can then process in different manners for different purposes. Photomatix and all other HDR proggies allow us to reopen a 32-bit file in HDR mode, why not CS5? It is a waste of time and effort to merge files every time I want to reprocess an HDR file to 16 bit.

    Ah! My apologies. I didn't realize that the toning tools would come up (nor is it mentioned in the Adobe knowledgebase page I read on the subject of converting to 16/8 bit). I guess it should have been obvious, though, that there would need to be some control over how to map the tones. Actually, this appears to be the much better way to work with HDR tonemapping in CS5, since you have a real 100% preview, which is, sadly, lacking in the "real" HDR workspace. Great to have found this out.
    Thanks,
    Toby

  • How to create a 16-bit grayscale image from matrix of values

    Hello all,
    I'm having a problem converting a series of measurements into a specific image. I have a matrix of nxm dimensions (n and m variable), which contains measurement data. My intention is to transform this matrix into an image to be analyzed later on by an external software. The trick, however, is that the image has to be in 16-bit grayscale format: in grayscale for doing the image processing, and 16 bits to make sure that resolution is not hindered.
    I've been looking around the web and still haven't found a way of somehow mapping the measurement values I have in that matrix into pixels (16-bit grayscale ones, that is). I have access to the Full Development System version of LabView, but not other toolboxes.
    Does anyone have any suggestions?
    Solved!
    Go to Solution.

    Hi everyone,
    I've managed to get it to work thanks to some help from people on other forums. The key is to use the IMAQ driver, which gives the VIs necessary to create images on 16-bit grayscale (only supported nicely by PNG format apparently).
    The discussion on the other forum can be found here: http://stackoverflow.com/questions/11101420/structure-of-16-bit-grayscale-image-to-be-generated-in-c...
    The IMAQ driver can be found here: http://search.ni.com/nisearch/app/main/p/bot/no/ap/tech/lang/en/pg/1/sn/catnav%3adu,n13%3ahardwareDr...

  • How to encode 16bpp grey images in Jpeg2000?

    Hi all.
    First excuse me for my bad English.
    I have a problem encoding JPEG2000 images. I have an image in a short array and I want to encode and seve it in a jpeg2000 file. I do the next:
    (iw) is the JPEG2000 image writer.
    SampleModel model =
    RasterFactory.createBandedSampleModel(DataBuffer.TYPE_SHORT, w, h, 1);
    WritableRaster raster = Raster.createWritableRaster(model, new Point(0, 0));
    int ai1[] = new int[0];
    for(int x = 0; x < w; ++x)
    for(int y = 0; y < h; ++y)
    ai1[0] = getPixel(x,y)
    raster.setPixel(x, y, ai1);
    iw.setOutput(fios);
    iw.write(new IIOImage(raster,null,null));
    fios.close();--------------------------------
    The resulting image is corrupted.
    If I set DataBuffer.TYPE_BYTE instead of DataBuffer.TYPE_SHORT it works fine but truncating data.
    Then, How can I save 16bits grey image?
    Thank you.
    Edited by: francadaval on Mar 9, 2009 4:44 AM
    Edited by: francadaval on Mar 9, 2009 4:48 AM
    Edited by: francadaval on Mar 9, 2009 4:49 AM
    Edited by: francadaval on Mar 9, 2009 4:50 AM

    I can't reproduce this. I'm using JAI 1.1.3.
    Are you sure that in this bit of code
    int ai1[] = new int[0];
    for(int x = 0; x < w; ++x)
        for(int y = 0; y < h; ++y)
            ai1[0] = getPixel(x,y);
            raster.setPixel(x, y, ai1);
    }the method getPixel(x,y) is not returning 0?
    Note that in this revised bit of code
    SampleModel model =
         RasterFactory.createBandedSampleModel(DataBuffer.TYPE_USHORT, w, h, 1);
    DataBuffer dBuffer = new DataBufferUShort(sPixs,w*h);
    WritableRaster raster = Raster.createWritableRaster(model, dBuffer, new Point(0,0) );
    iw.setOutput(fios);
    iw.write(new IIOImage(raster,null,null));
    fios.close();all you are doing is writing an empty image. You created a raster but don't set its elemnts. So the data buffer has all zeros (which is the color for black).

  • Unable to create an encrypted disk image in Lion

    disk utility gives the error Unable to create "Volume.dmg." (error - 60008) when creating an encrypted disk image. I am using the following steps:
        1.    Open disk utility
        2.    Select the disk (internal or external) to create the image on
        3.    Select File>New>Blank Disk Image…
        4.    Save As: 'Volume'
        5.    Name: Volume
        6.    Size: 50GB
        7.    Format: Mac OS Extended (Journaled)
        8.    Encryption: 128-bit AES encryption
        9.    Image Format: read/write disk image
        10.    Click the Create button
        11.    Password dialog appears
        12.    When I enter a password the dialog closes after entering only a few characters i.e. before I've finished typing, and the following error message displays:
    Unable to create "Volume.dmg." (error - 60008)
    I have previously, successfully, created encrypted disk images in Snow Leopard, and I don't know why I can't in Lion
    Does anyone have any ideas?

    Thanks for this Thomas.
    I've tried naming the image differently, but still received the error, I did however try different permutations for the password.
    The error seems to happen if I use a purely numerical password string and occurs on input of the 10th numerical character, if I start with numerical character but use an alpha before the 9th number I can continue and create a password, and I can create a password  if I start with an alpha and switch to numerals after the first alpha character, purely alphabetical passwords are fine too.
    It seems that Lion doesn't like purely numerical passwords greater than 9 characters, whereas Snow Leopard wasn't so fussy. Seems it's a bit of a bug.
    Thanks for your help

  • Unable to create an encrypted disk image with Disk Utility

    Hi:
    With our upgrade to Lion a few weeks ago, we're now unable to create an encrypted disk image of any type using Disk Utility any more. This problem occurs on 3 different machines, and is reproducible whether one is using an internal HD or an external FW HD. We can successfully create nonencrypted disk images.
    This is a duplicate post with all the details here: https://discussions.apple.com/message/18469359#18469359
    We haven't had any luck with a solution trying various permissions fixes as helpfully suggested by other readers in response to the error message # (-60008 error), so I'm hoping that someone else has run across a solution from the encrypted disk image perspective and that this tag line will generate some help.
    Thank you!

    Save As: 01 (on Desktop)
    Name: 01
    Size: 100 MB
    Format: Mac OS Encrypted (Journaled)
    Encryption: 256-bit AES
    Partitions: Single partition- Apple Partition Map
    Image Format: read/write disk image
    At the password window that pops up I enter: 1234567890
    This says password strength is "Weak"
    All works fine
    Then I repeated this using:
    Save As: 02 (on Desktop)
    Name: 02
    Size: 100 MB
    Format: Mac OS Encypted (Journaled)
    Encryption: 256-bit AES
    Partitions: Single partition- Apple Partition Map
    Image Format: read/write disk image
    At the password window that pops up I enter: 1234567890 and when I start to enter the next "1" I get the "Unable to create "02.dmg." (error -60008)
    OS 10.7.4
    Disk Utility Version 12.1.1 (353)

  • Why do 16 bit greyscale images look significantly worse than 32 bit?

    Howdy,
    I am trying to display a greyscale image from a camera. Parts of the program are written by someone else, and the image comes in as a U16 array. I am using IMAQ create and IMAQ arraytoimage. The image displays perfectly if I use the 'float' inputs on the above to sub vi's, but if I use 16 bit or 8 bit, the image quality is terrible. I would like to be able to display the image as 16bit.
    If I save the 16 bit image, and reopen it with another program, it's still just as bad. I have also tried converting the array to I16, and U8, but it makes no difference to the image quality.
    From what I understand, there should be very little visible difference between 8, 16 and 32 bit greyscale images. Does anyone have any ideas where the problem might be? my next guess is the camera settings, but I'd love it to be something in my code..
    Cheers,
    Andy

    Andy,
    Thank you for contacting National Instruments.  The key thing to note is that the image data type that LabVIEW uses is a signed interpretation so you need to do some more conversion to get an Unsigned 16-bit array to display properly as an NI-IMAQ image.  Refer to the Knowledge Base: 16-bit Images in NI-Vision for more information on how to do this.  Thanks and have a great day.
    Regards,
    Mark T
    Applications Engineering | National Instruments

  • 64-bit Boot Image Drivers Are Not Working

    I've been deploying Windows 7 x86 and x64 for years. I've been using the same 32-bit boot image for both and it's been working great.
    We've decided to take the plunge and go all x64 moving forward.  I want to switch to a 64-bit boot image so I don't have to curate the drivers for two architectures.
    I've created a 64-bit boot image, and included all of the 64-bit versions of the drivers in my 32-bit boot image, but they don't seem to be working.  I've tried booting 3 different models, but I receive "Failed to find a valid network adapter."
    I've looked within the boot image, because I wanted to see the driver files.  Either I just don't know where I'm looking, or they're in the "Files" folder where each file is renamed to a number.
    What might I have done wrong?

    I've solved my problem by downloading and importing the Dell WinPE driver pack.  Now I've just got to add the USB 3.0 drivers (I support laptops that don't have optical drives), and I'll be set.

  • Create repeating / tiled background images

    I may have missed this in the previous versions of Adobe Photoshop.
    Is there "a way / or method" to create repeating / tiled background images in photoshop?
    Many times a "tile" for a tiled background is quite small at around 150px x 150px.
    1:
    It would be very nice to be able to work on the tile, be able to zoom in and out of it, and actively see a functioning live tiled background.
    Yes it might be a bit like a kaleidescope, but it would be live and you would see any harshness in the pattern and can remedy glitches it in real time.
    2:
    It would also be very nice to be able to "draw / paint / edit" off the edge of the tile and have the effect carried over to the other side...
    Yes just like in Asteroids.
    I think creating Tiled BG's is a very strong contender for being one of the more frustrating things I do with Photoshop. I hope the above ideas can be added to PS6.
    Just to you you know... DPaint IV for the Amiga did this very well back in 1990'ish.

    There will not be any substantial changes to CS6 to add new features beyond the beta. We are too far along in the process for that. To accomplish what you desire, can you use the pattern feature to tile?  For any new features you wish to request, you can to to this website  http://feedback.photoshop.com/photoshop_family  people can vote on the favorite features.
    Pattie
    Use the Rectangle Marquee tool on any open image to select an area to use as a pattern. Feather must be set to 0 pixels. Note that large images may become unwieldy.
    Choose Edit > Define Pattern.
    Enter a name for the pattern in the Pattern Name dialog box.

  • How to create a grayscale georaster image

    Hi,
    This is the code that i am using to create a georaster template image.
    sdo_geor.createTemplate(idw_img, 21001,
    'dimSize=(512,512,3) cellDepth=32BIT_REAL interleaving=BIP ',
    null, 'TRUE');
    Anyways, the above code works and when i try to export, i can see a rgb image file.
    But, i need to create a grayscale image. Can anyone let me know how can i specify and create a grayscale georaster image. Please note that my cell values are decimals type.
    Thanks,
    Bal

    Balaji,
    In your second command, you copied the "*" from my post. That is not part of the command. It supposed to turn the text into bold. Sorry for the misunderstanding.
    My suggestion was for you to try to work with a single-band image. I don't know what are the other commands you have in your code but are you sure that the error message "invalid band and layer number" is coming from sdo_geor.createTemplate? You might have some code after that is still expecting the 3 bands and that is where the error is coming from.
    So here is the summary:
    If what you want to see is a "grayscale" image and your data type is 32BIT_REAL, there is no need to 3 bands. If you have to have 3 bands. You can use GeoRasterViewer and play with the option "View>Show Layer Mapping" or alt+p to select the band you want to see. If you want to see band 1, select "1" for Red, "1" for Green and "1" for Blue and click on "Refresh".
    Photo viewers can only handle well unsigned 8 bit integer. I suspect. On GeoRasterView you might try the "Image" processing option to find the best representation of the cell values of that image.
    Regards,
    Ivan

  • Can't create text on this image in PSE10

    This has got me stumped.  There's something strange going on with this image.  I downloaded it from the Web, and can't create text on it -- text that's visible.  The text layer is created (I can see it in the Layers palette), but no matter what font, size or colour I use, the text does not appear on the image.  I've re-saved the file in PSE10, and as another image in PhotoPaint X5 (which can create text on the image just fine) to no avail.  Here's the image that was saved as another image in PP, but still doesn't work with the text tool in PSE10:
    It's not an important image, just one I use as a test case, but it's driving me crazy.
    Ken

    Aha!  I figured it out.  I used File...Open As to open it as a Camera RAW file.  In the ACR editor, it was showing as 16-bit depth.  Changed it to 8-bit and saved it.  Now the Text tool works!
    Ken

  • Before/after: LR4.1 for 32-bit HDR images - wow!

    I have given the new support in LR4.1 for 32-bit HDR images a try. I'm very impressed.
    Here's an old version (Photomatix I think) of an HDR I shot a few years ago:
    Not so bad, huh?
    Now look what I could do after creating a 32-bit tiff and importing into Lightroom:
    The new defringing is awesome to have. The fringes can become so very visible otherwise when making HDR.
    I've got all the gory details of how I did this on my blog:
    http://davidnaylor.org/blog/2012/05/lightroom-4-32-bit-hdr-editing/
    Anyone else who has given this a spin?

    Actually, I think I may have been wrong there. I believe I actually used
    Photoshop to develop the old version. Even so, I prefer Lightroom's output
    to anything Photomatix would produce.
    Den 3 maj 2012 00:46 skrev "Susan S." <[email protected]>:
       Re: Before/after: LR4.1 for 32-bit HDR images - wow!  created by Susan
    S. <http://forums.adobe.com/people/Susan+S.> in Photoshop Lightroom - View
    the full discussion <http://forums.adobe.com/message/4375488#4375488

  • Create a new Buffered Image using Raster and ColorModel

    Sorry , I crosspost this message,because no one reply.
    Recently,I write a programme combining C++ and Java .
    The C++ part create a array containing image data in form of BI_RGB and biBitCount==32.
    The java part create a image using Raster and ColorModel like this:
       static int[] data ;
       DataBuffer db = new DataBufferInt(data, data.length);
       WritableRaster wr =Raster.createPackedRaster(db, 1024,768, 32, null);
       ColorModel cm = new DirectColorModel(32,0xff0000,0x00ff00,0x0000ff);
       img = new BufferedImage(cm, wr, false, null);But it doesn't work .
    it report this:
    Exception in thread "main" java.lang.IllegalArgumentException: Raster sun.awt.im
    age.SunWritableRaster@dff3a2 is incompatible with ColorModel DirectColorModel: r
    mask=ff0000 gmask=ff00 bmask=ff amask=0
    at java.awt.image.BufferedImage.<init>(BufferedImage.java:549)
    at monitor.test.Perform2.main(Perform2.java:39)

    hey epico
    compiles & runs 4 me
    see javadocs for SinglePixelPackedSampleModel
    import java.awt.image.*;
    public class Tester {
    DataBuffer db;
    WritableRaster wr;
    ColorModel cm;
    BufferedImage im;
    int[] data;
    int[] masks;
    int w = 768;
    int h = 576;
      public Tester() {
        data = new int[768*576];
        for (int i = 0;i < w*h ;i++ ) {
          data[i] = 0;
        masks = new int[3];
        masks[0] = 0xff0000;
        masks[1] = 0x00ff00;
        masks[2] = 0x0000ff;
        db = new DataBufferInt(data,data.length);
        SinglePixelPackedSampleModel sm = new SinglePixelPackedSampleModel(DataBuffer.TYPE_INT,w,h,masks);
        cm = new DirectColorModel(32,0xff0000,0x00ff00,0x0000ff);
        wr = Raster.createWritableRaster(sm,db,null);
        im = new BufferedImage(cm,wr,false,null);
      public static void main(String[] args) {
        Tester tester1 = new Tester();
    }

  • How can I create a java.awt.Image from ...

    Hi all,
    How can I create a java.awt.Image from a drawing on a JPanel?
    Thanks.

    JPanel p;
    BufferedImage image =
        new BufferedImage(p.getWidth(), p.getHeight, BufferedImage.TYPE_INT_RGB);
    Graphics2D g = image.createGraphics();
    p.paint(g);
    g.dispose();

  • How can I create a high res image gallery, need to have print res photos for a pressroom section.

    How can I create a high res image gallery, need to have print res photos for a pressroom section.

    If you want Muse to "pass through" your images and not adjust, compress, crop etc - you need to place your images in the lightbox EXACTLY at the right size, pre-cropped and prepped in Photoshop.
    So if your light box is 800x600 the image you're dropping into that must be 800x600 exactly with no effects, rotation etc added to the lightbox frame. This stop Muse fiddling with your images, if they are perfect when inserted and you're not asking Muse to crop, expand, add effects etc. If it's perfect when inserted, Muse SHOULD also leave the resolution alone too, but I have not tried that one, but in theory, it should work.

Maybe you are looking for

  • Maximum number of connection profiles and group policies for Cisco ASA

    Hi, We have a Cisco ASA 5520 running 8.0(2) that we use only for Remote Access VPN. Does anyone know how many connection profiles and group policies that are supported on the box? I have not been able to find this in the manual. Thanks in advance for

  • N8 Belle more of issue than fun

    I am using Belle for more than a month now and came up with these issue. 1. when i am using foursquare app with mobile data just connected, it hangs the device. 2. Once I disconnect from a Wi-Fi network, after a second or so all the icons reinitializ

  • Which Is Best . . Mac or PC ??

    I am considering purchasing Adobe Production Premium CS6 and considering a new computer at the same time.  Which platform would be best with this product bearing in mind that I have equal experience with both Mac and PC platforms and have previously

  • File or assembly name Oracle.DataAccess, or one of its dependencies not fnd

    I need to install my old batch programs (using VB.NET 2003) onto a new server. I had the DBA install Oracle Client and ODP.NET on this machine. I installed the batch job onto this new server and when I try and test the program, I get the above error:

  • Wifi won't connect to WPA2 network after waking from sleep, requires reboot

    My office has a WPA2 network that I use my MBP to connect to. When I go home for the day, I close the MBP and put it to sleep. When I get home and open it, it automatically connects to my home wifi network. I do the same coming back to work and when