Creating a grayscale picture

Hello!
I have such an array:int[][] testArray = new int[heightOfImage][widthOfImage];The array is filled with numbers from 0..255. How could I create a gray scaled tiff image with JAI?
I found this line, but how could I set the imageVariable from my testArray and how could I set it it that it will be grayscaled?
JAI.create("filestore", imageVariable, "myNewTiff.tiff", "TIFF");Does anyone know?
Thanks a lot in advance & Best Regards.

PHANTOMIAS wrote:
..The array is filled with numbers from 0..255. How could I create a gray scaled Convert it to grayscale before doing anything else. E.G.
import java.awt.*;
import java.awt.image.*;
import javax.swing.*;
import javax.imageio.*;
import java.net.URL;
class ToGrayscale {
    public static void main(String[] args) throws Exception {
        URL url = new URL("http://pscode.org/media/stromlo1.jpg");
        Image image = ImageIO.read(url);
        BufferedImage bi = new BufferedImage(
            image.getWidth(null),
            image.getHeight(null),
            BufferedImage.TYPE_BYTE_GRAY);
        Graphics g = bi.createGraphics();
        g.drawImage( image, 0, 0, null );
        JPanel p = new JPanel(new GridLayout(0,1));
        p.add( new JLabel(new ImageIcon(image)) );
        p.add( new JLabel(new ImageIcon(bi)) );
        JOptionPane.showMessageDialog(null, p);
..tiff image with JAI?
I found this line, but how could I set the imageVariable from my testArray and how could I set it it that it will be grayscaled?
JAI.create("filestore", imageVariable, "myNewTiff.tiff", "TIFF");Does anyone know?<DWS>Of course not. You are the first person in the history of computing to consider such an idea - you maverick.</DWS>

Similar Messages

  • Have a problem with my MacBook Pro.5,3 and monitor.  Intermittently, the desk top screen becomes broken up into vertical sections, which appear in the wrong order, creating a haphazard picture.    The Apple icon, usually at top left corner, appears in to

    have a problem with my MacBook Pro.5,3 and monitor.  Intermittently, the desk top screen becomes broken up into vertical sections, which appear in the wrong order, creating a haphazard picture.
    The Apple icon, usually at top left corner, appears in top right corner  in a strip including all that left hand.  When the computer is restarted, the screen goes back to normal.  But I have to move the mouse to the far left of the screen and then up until it reappears on the far right hand side of the screen so that I can hit shut down button.
    It seems to happen randomly though always on desk top and sometimes when I move mouse and computer switches on from rest mode.   My large flat screen is relatively new.
    The video card on this computer, which is approximately two years old, is Nvidia FeForce 9400M.
    Any help would be welcome as my usual source of assistance is not available and I am not well versed in workings of the Mac although I have used one for many years.

    That sounds like a Hardware problem.
    You may be able to confirm that with Apple Hardware Test, or make an appointmenst for a free Genius Bar evaluation.

  • How do I re-assemble two halves of a large scanned photo to create the original picture in CS3

    How do I re-assemble two halves of a large scanned photo to create the original picture in CS3

    Good day!
    Is there overlap between the scans?
    If so File > Automate > Photomerge might be enough, otherwise you can load both images in one document and manually align/distort them and address color/brightness-diferences with Adjustment Layers.
    Regards,
    Pfaffenbichler

  • How do I create a moving picture with Photoshop?

    Hi, I want to create a moving picture using photoshop for my web www.yoshiwafa.com Is it a difficult job for a Beginners Photoshop?

    What version of photoshop do you have and what format were you thinking about?

  • Can anyone recommend an alternative software programme to Pages? I have an OS X 10.7.5 macbook pro, so I am unable to get it. I want a programme that I can create docs with pictures and text on, invitations, posters etc. Many thanks in advance-..

    Can anyone recommend an alternative software programme to Pages? I have an OS X 10.7.5 macbook pro, so I am unable to get it. I want a programme that I can create docs with pictures and text on, invitations, posters etc. Many thanks in advance…..

    LibreOffice

  • How to creat a preview picture for a widget?

    Thanks for reading....Some widgets show a preview picture when you click(select) it in the library panel, like the Meta+ Lite widget(http://muse.adobe.com/exchange-library/meta-43-lite). How to do that? I cann't find anything about how to creat a preview picture in MuCow Documentation(http://adobe-muse.github.io/MuCowDocs/).

    It's a little tricky but if you follow these steps you should be ok, first download and install 7zip since you will need it. Then do the following:
    1. Export your mucow file out as a mulib (muse library file). If you don't know how to do this read this pastebin.
    2. Once exported out you should delete the folder you just made.
    3. Right click on the exported mulib file on your hard-drive and choose from the popup menu: 7-zip/Open Archive.
    4. Inside you should see 3 files like the following (in this case I named my mucow "demo"):
    manifest.xml
    demo.muse
    demo.png
    You'll notice you have a PNG file in your archive BUT it is empty. So what you need to do is leave 7-zip open and create your PNG in photoshop or whatever program you use. Make sure to name it the exact name in the archive (in my case demo.png)... a good size is 210x98 px. Save out your PNG and drag it on-top of the PNG in your archive and it will be saved. You can then close 7-zip.
    You can then import your mulib file into the muse library panel and you should see your widget now has that PNG you created as a thumbnail image.
    -hope this helps!!

  • How to create a fancy picture frame border around an image

    Hi there,
    Does anybody know how to create a fancy picture frame around
    an image that's inside an AP DIV? I want the image to look like
    it's a picture hanging on the wall. Any of your guru's know how to
    do that - eh then?
    Thanks a mill for any help!

    Find or use your graphics program to create an image of a
    frame you like.
    Size it so its inside measurements match your picture.
    Option 1 - Paste your picture image on the frame image and
    insert in your container.
    Option 2 - Place your frame image as a non-repeating
    background for your container and then insert your picture.

  • 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

  • How to create animated GIF pictures?

    I want to create rotating pictures for my site. I have Photoshop and ImageReady on my computer but don't know how to start. I want recommendation for a good site or link that has tutorials on this subject. Thanks
    Anicha

    A good program for making animated gif files is iDraw.
    It's free, easy to use and you get it here:
    http://www.macupdate.com/info.php/id/7325/idraw
    Regards,
    Cédric

  • How can I create a flash picture slideshow for 3 images

    Hi. I am wondering if anybody can tell me how to create a picture PUSH. I have three images that I wish to work with. By pushing I mean having an image come in from the left (or right) and place itself on top of the other (or pushing the other out of view). Like a slide show of three images scrolling along but one stops for a brief period before the other image comes into view.
    Any help would be appreciated. Thanks!!!

    http://www.hongkiat.com/blog/30-free-flash-photo-galleries-and-tutorials/

  • How to retrieve the "date created" of a picture file?

    Hi there
    How can I retrieve the date of the creation of a file?
    It's picture I have scanned, I need to authentify it's date of creation.
    Finder doesn't do it
    A utility in Photoshope CS3 ( XMP ) doesn't seem reliable.
    Is there any way I can retrieve with a utility , the code of the file and its date of creation?
    Much help appreciated
    PS:I dont have Aperture ( I figured I could ask in this forum)
    thanks

    Finder does do it. Select the file and choose File>>Get Info (command + i)
    It will tell you the date created and the date last modified.
    DLS

  • Strange "iPOD" Files being Created in My Pictures Folder

    A friend of mine wants to know why PSE7 seems to be creating these files in the My Pictures folder whenever she clicks on a PSD file (for example) to start PSE editor? It also seems that if she uses one of the effects on a pic these IPod files are also created.
    She has hunderds of these things floating around in various folders. PSE also feels the need to create a manifest.txt file to list them all.
    IPod_adding_drama
    IPod_advanced_dodge_burn
    IPod_blending_layers
    IPod_blurring_background
    IPod_correcting_images_batch
    IPod_correcting_perspective
    IPod_create_greeting_card
    IPod_create_pdf_slideshow
    IPod_create_slideshow
    IPod_curved_photo
    IPod_frame_layers
    IPod_generic
    IPod_getting_slideshows_on_tv
    IPod_hockneyesque
    IPod_insider_tips
    IPod_lightening_eyes
    IPod_making_skies_blue
    IPod_panorama
    IPod_photo_collage
    IPod_photo_frames
    IPod_photo_mail
    IPod_pic_in_pic
    IPod_quick_fix
    IPod_scalloped_brush
    IPod_scene_clean
    IPod_sharpening_tools
    IPod_travel
    IPod_type_masks
    IPod_unsharp_mask
    IPod_whimsical_woodcut
    Thaks
    Jeff

    See the ongoing discussion in:
    http://www.elementsvillage.com/forums/showthread.php?t=47557

  • How to create slideshow for pictures on blank page

    G'day,
    I'm just starting to use iWeb 09 and would like to ask a really basic question. My apologies in advance if it has been asked and answered in the past.
    I have created a page using the "blank page" template and added some text and pictures. On the photo page, I understand that you can click on a photo to see a larger version and to run a slideshow. Is it possible to create this functionality for pictures placed on a blank page? Or is this functionality only available on a photo album page?
    Thanks for your help.
    Regards,
    Doug

    Doug:
    I believe you can do so. Create the photo page, click on the thumbnail layout box and copy it. Go to the blank page and paste. You'll have to lengthen the page using the Inspector/Page/Layout pane so the entire thumbnail layout box is visible in the body. Then go back and delete the photo page.
    This test slideshow page was copied from another site in iWeb and pasted on a blank page: PhotoCopy. It seems to work just like the Photo page.
    OT

  • Creating a 50% picture in picture effect in Pr CS3

    I am learning CS3 for the first time after 4 years on Avid. One of my struggles........
    I need to create a split screen, equally showing 2 layers of video, a 50% picture in picture effect if you will separated by a thin black divider line. I only see the 25% PiPs on Premiere Pro and can't find any other PiPs in After Effects.
    Can anyone tell me how to do this effect?
    I thank you in Advance
    Bruce

    You will find links to many
    free tutorials in the PremiereProPedia that will quickly show you how things are done in Premiere Pro.
    Specifically:
    Picture-in-Picture
    Cheers
    Eddie
    PremiereProPedia   (
    RSS feed)
    - Over 300 frequently answered questions
    - Over 250 free tutorials
    - Maintained by editors like
    you
    Forum FAQ

  • IMac initail setup hangs when creating user account picture.

    I just purchased a brand new Imac. When I attempt to create my initail user account I am asked if I want to take a new picture for this user account.
    The Imac then hangs when I click on the check box to take a picture. Can someone please advise me on this procedure?

    It should work, but either skip that part for now, or better yet...
    If 10.7.0 or later...
    Bootup holding CMD+r, or the Option/alt key to boot from the Restore partitirion & use Disk Utility from there to Repair the Disk or Reinstall.

Maybe you are looking for

  • MS 7309 Memory Upgrade

    I have a question regarding a memory upgrade for the MS 7309 (K9)motherboard;  A60 BIOS, Upgraded to 800Mhz DDR2 memory from 5400, with WinXp OS.   I am experiencing system stability problems with both 2 Gb sticks installed,  the system is stable on

  • Itunes store has stopped working On windows 8

    with the most recent update of iTunes (2015, 12.1.1.4- or even later) The iTunes store has stopped working. Every time I open it a window pops up saying "ITunes has stopped working" and then I am forced to close the program and can't get back on it.

  • Apple Mobile Device Ethernet fails to install

    Hi, I have tried to install on my laptop running Windows 7 the "Apple Mobile Device Ethernet" driver several times, but each time, I get an error message saying that there's not enough system resources to complete the requested service. All other iPh

  • Cisco ACS 4.2(1) Certificate problem

    Hi guys, I am trying to upgrade the OS from w2k3 to w2k8 STD 32bits. I am using Cisco ACS v. 4.2.(1) path level 15 on this OS. When i try to activate de EAP-MSCHAPv2 after creating certificates (self sign or using external CA), the follwing problem i

  • Matrix display

    Is there any easier way to make my matrix to display properly? Instead of: -1 6 10 5 4 -45 to -1 6 10 5 4 -45 below is part of my coding. System.out.println("\nThe transpose result is"); for(int i=0;i<m3.getRows();i++){ for(int j=0;j<m3.getCols();j++