Dispay an image pixel by pixel

Hy! i want to read an image, bmp or jpg and then display it on the screen pixel by pixel....can you help?
thanks!
Message was edited by:
zzirna

http://forum.java.sun.com/thread.jsp?forum=31&thread=313033
could prove to be of some interest

Similar Messages

  • What is the maximum size of an image height (in pixels) that supports Muse? I noticed that if the photo is too high, reduce the Muses. thanks

    What is the maximum size of an image height (in pixels) that supports Muse? I noticed that if the photo is too high, reduce the Muses.
    thanks

    Thanks for the explanation, it was very helpful
    Paolo Guercio
    Il giorno 11/nov/2014, alle ore 17:00, Vikas.Sharma <[email protected]> ha scritto:
    If you place in Muse - an image with either height or width larger than 2048 pixels - Muse scales the image down proportionately, limiting the larger dimension to 2048.
    However, if you want to use the placed image at its original size, you can scale the image up to desired size either by dragging the resizing handles or by entering Height and Width values in the Control Strip on top. After that, go to the Assets panel and locate the image in there, then right click that image in Assets panel and choose "Import Larger Size". That would bring back the lost image information from the original image.
    Hope this gives you clarity on what you wanted to know.
    Cheers,
    Vikas
    >

  • Images with negative pixels value

    Consider a simple black (0) and white (255) image composed by 3 vertical bands : the first is white, the second is black and the third is white. Image size is W columns by H lines. Band width is W1, W2, W3 for bands 1, 2 and 3 respectively (W1+W2+W3=W).
    Consider now a first order edge detecting operation, for example Sobel for vertical edges :
    1 0 -1
    2 0 -2
    1 0 -1
    The corresponding edge image is composed of H identical lines (because the image is only varing horizontally). Each line is 0 everywhere, except on transitions : on column W1, there is a positive value of 4*255 and on collumn W1+W2 there is a negative value of -4*255.
    Using the following java source code, we obtain an image which have only the positive (>=0) part of each line :
      Image img = (new ImageIcon("bands.png")).getImage();
      BufferedImage bimg = toBufferedImage(img); // not part of JDK1.4
      ConvolveOp sobel = new ConvolveOp(new Kernel(3,3,new float[]{ 1, 0,-1,2,0,-2,1,0,-1})); // vertical Sobel filter
      BufferedImage bimg_cont = sobel.filter(bimg, null);To have an edge image that contains the negative part of edges, we do need a specific image format with specific ColorModel and SampleModel. Ideally, we will need a grayscale image (1 sample/pixel) where all elements can represent values from -4*255 to 4*255. So we need a signed type like DataBuffer.TYPE_SHORT, DataBuffer.TYPE_FLOAT or DataBuffer.TYPE_DOUBLE.
    Note : it is possible to apply the filter twice, with a mirrored filter, but time to compute will be also twice the normal computational time (very inefficient).
    Now, this is the question : do anyone have a solution to compute a sobel filter (or any other filter type which produces negative values) with a resulting image containing positive and negative values ?

    The problem is the size of the number you have to work with. You can store values ranging from 0 to 255 (the max index for a byte-sized variable) so the total numbers you can store is 256. However, if you want to go from -255 to 255, thats about 512 values, which is twice the size of your max. You would need one more bit on that variable to do that. You could make the far left variable be the positive or negative sign (know as a signed variable) which is how computers do it anyway. The only drawback is it will only range from -127 to 127, which is half as much detail.

  • Do I need to reduce the images size in pixels before upload them to M.Me?

    Do I need to reduce the images size in pixels (actual size jpeg 5616 × 3744 pixels/766kb) before upload them from iPhoto to a Mobile Me Gallery?
    Otherwise they will be heavy or the upload process take care of that?
    It would be nice that iPhoto took care and optimize the images to display online without any more work, because I´ve 1200 images to upload and they´re jpegs 5616 × 3744 pixels. It´s just to viewing purposes. Not o download or print.
    Thanks.

    In fact no matter if I use a High or Medium compression size JPEG, the size after upload is the same.
    Starts with 1,5 MB/5600px (high) or 780kb/5600px (medium) JPEG and ends after upload in 115kb for a 1024px image.
    This means that iPhoto auto compress in order to publish to Mobile Me, even if we start with a bigger file.
    I hope this info is useful to others.
    Thanks.

  • Pixel by pixel image manipulation- java

    Hey guys, i need to write a bit of code that looks at 3 images, assesses which pixels in ALL 3 are grey, and then redraws a new image consisting of the old ones, but grey only showing where all 3 have grey.
    The inputs are mays with grey overlays, so therefore the output pixels should be the same UNLESS the pixel was grey in all 3.
    I know its to do with arrays but im not a very good programmer and i need to get this done. Ive written the rest of my program, is anyone able to write this simple code? My problem is that i dont really know how to create an image using an array, plus also i know the pixel colours are stored awkwardly too. Ive only been programming in java for 4 weeks!

    The BufferedImage class is really good at creating images from an array. I don't know what a may is, but if you had an array of integer values in the format {a, r, g, b, a ,r, g, b}, it would be as easy as this:
              BufferedImage b = new BufferedImage(5, 5, BufferedImage.TYPE_4BYTE_ABGR);
              b.getRaster().setPixels(0, 0, 2, 1, new int[] {128, 64, 32, 16, 128, 75, 50, 25});Hope this helps.

  • When I export a photo from lightroom, the image is very pixelated.

    When I export a photo from lightroom, the image is very pixelated. This pixelization occurs irrespective of whether I make adjustments in Lightroom.  It seems that just placeing the photo into he develope modual  without doing anything to it taints the image in such a manner that when it is exported from the develope modual the expot comes out pixelated.

    Brett,
    The photo i was a panorama knitted in Photoshop from four photos which were approx 3.3 MB each. The knitted pic came out to be 1.10MB. The panorama pic I was trying to refine in Lightroom and export came out to be 70.9 KB and extremly pixilated. Whether I altered it  in Lightroom  or not didn't matter.
    I can't imagine that bringing up the photo in the Develop modual would result in pixilization when it was exported regardless of whether it was altered or not altered.!!
    Attached is  a copy of the Photoshop saved and Lightroom exported photos before and after. I appreciate your help and interest. The top pic 1.10MB is what was saved on Photoshop. The bottom pic 70.9KB is the unaltered pic exported out of the Develop modual exhiiting the pixelization.

  • Saved Image is Very Pixelated on iPhone, Seeking Remedy

    Upon saving a two-image original file to my iPhone, the saved new image is very pixelated. Is there a remedy for this?  In Photoshop Mix.

    We are aware of this issue and hope to get it fixed ASAP. Thanks for your patience!
    Armin Samii
    Developer, Photoshop Mix

  • Guys, i want to ask on how to resize the images into 1200 pixels wide?

    Guys, i want to ask on how to resize the images into 1200 pixels wide, how to do it? and what are the step by steps on doing that? thank you!!!

    See this link: http://forums.adobe.com/docs/DOC-3691

  • Resize intensity image based on pixel dimensions

    Hi,
    I want to resize an intensity graph to an exact pixel-by-pixel size, but I do not see this option anywhere.  Right now I need to create a 257x256 intensity graph on the front panel, but I have no idea how to do this.  Does the graph automatically reshape the viewable area based on the dimensions of the 2d array that I provide it?
    Thanks,
    Anthony

    Hello,
    There is an intensity graph property available called Plot Area: Size which will set the plot area (width and height) in pixels - I think this is exactly what you are looking for.  Attached is an example of this in version 7.1, otherwise you can just right click the intensity graph on your block diagram and Create -> Property Node, and then use the operating tool on the property node to select the noted property.
    Best Regards,
    JLS
    Best,
    JLS
    Sixclear
    Attachments:
    Programmatically Set Intensity Graph Plot Area in Pixels.vi ‏24 KB

  • Can you make a background a random multicolor, pixel by pixel?

    In any basic window, would you be able to color the background, like, a random multicolor? Let me explain...
    Say I have a window that was generated with Java. Typically, this window would have a white background. Instead of that, I'd like the background to be a continuously changing random bunch of colors, pixel by pixel. So, it would be just a giant mess of crazy colors.
    Is there a way to do this? I searched online, but didn't find anything.
    This isn't really important to me, just something I thought would be fun to do.
    ~Dac

    import java.awt.event.*;
    import java.awt.image.*;
    import java.util.*;
    import javax.swing.*;
    import javax.swing.Timer;
    public class TVExample implements Runnable, ActionListener {
        private Timer t = new Timer(10, this);
        private JLabel label;
        private BufferedImage image;
        private Random r = new Random();
        public void run() {
            image = new BufferedImage(100, 100, BufferedImage.TYPE_INT_RGB);
            label = new JLabel(new ImageIcon(image));
            JFrame f = new JFrame();
            f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            f.getContentPane().add(label);
            f.pack();
            f.setResizable(false);
            f.setLocationRelativeTo(null);
            f.setVisible(true);
            t.start();
        public void actionPerformed(ActionEvent evt) {
            int x = r.nextInt(image.getWidth());
            int y = r.nextInt(image.getHeight());
            int rgb = r.nextInt(0x1000000);
            image.setRGB(x, y, rgb);
            label.repaint();
        public static void main(String[] args) {
            SwingUtilities.invokeLater(new TVExample());
    }

  • Pixel by pixel

    Hi to every one..
    m new at j2me and at this forum too... and have started working on face
    recognition in j2me..
    but for now i want to do a pixel by pixel matching of two images..
    can i do it with immutable images? or necessary to do it with mutable ones?
    and one more question plz..
    if i've displayed the image like this
         image = Image.createImage("/randy_orton.png");
              imageItem = new ImageItem(null, image,
                        ImageItem.LAYOUT_NEWLINE_BEFORE
                        | ImageItem.LAYOUT_LEFT
                        | ImageItem.LAYOUT_NEWLINE_AFTER,null);
              form.append(imageItem);
    how can i now get the pixels of it or bytes of this image..
    plz gime ur suggestions ..
    thanks
    a small piece of code with a bit of discription would be of greater help..
    thanks in advance,,

    i went thorugh that API ahve searched some more things as well.. I have listened about the getRGB() and getPixels methods for it.. If you found a getPixels method, you're looking at the wrong API. I told you to
    Read the API for javax.microedition.lcdui.Image
    Not any of the classes in java.awt.image.
    but dont know how to use those...Do you know what an array is? How to access and assign values of array elements? If not, then go back to basics and go through some tutorials. Start here:
    {color:#0000ff}http://java.sun.com/docs/books/tutorial/{color}
    db

  • Pixel by Pixel Scan

    Hi all.
    I'm messing around trying to make a simple 2D game. Currently, I have a few sprites on the screen and collision detection working between them. My sprites have transparent backgrounds and the collisions occur when the sprites bounding boxes contact each other but unfortunately this means that things like missiles explode when they hit the bounding box of a ship rather than the ship itself.
    I want to perform a pixel by pixel scan of two sprites once a collision between them has been detected and allow their transparency to overlap until they hit 'solid' color. Basically I want my missile to explode when it hits my ship, not when their two transparent boxes hit each other.
    Anyone have any ideas how I would do this? I've used C++ APIs which have these functions built in but I have no clue as to how to do it in Java. Please help!
    Thanks.

    Heres some code from what I use.
      BufferedImage bi   = new BufferedImage(800, 500, BufferedImage.TYPE_INT_ARGB);
      public static byte[] getAreaCollisions(BufferedImage bi, int minX, int maxX, int minY, int maxY) {
        byte[] collisions = new byte[(maxY - minY + 1) * (maxX - minX)];
        int numCollisions = 0;
        for (int i = maxX; i > minX; i--) {
          for (int j = maxY; j > minY; j--) {
            if (Util.getAlpha(bi.getRGB(i, j)) > 0) {
              collisions[numCollisions++] = 1;
            } else {
              collisions[numCollisions++] = 0;
        if (collisions.length == 0) {
          System.out.println(minX + " " + maxX + " " + minY + " " + maxY);
        return collisions;
      public static int getAlpha(int pixel) {
        return (pixel >> 24) & 0xff;
      }May not be the best code, but it works :)
    CoW

  • Pixel-by-pixel graphics

    I'm working on a bioinformatics project that will use java. My data will be represented pixel-by-pixel, where the color of that pixel will represent of three variables in the dataset. The x and y dimensions are used for two other variables.
    I've been looking through the Java 2D API and tutorials, and there doesn't seem to be a tutorial on pixel-by-pixel specification. Everything seems to be discussing shapes and lines instead.
    In the end, I want a JFrame to pop up, draw the data to the screen, save the graph as a lossless, 8-color picture file, and terminate. Eventually, I hope to have thousands of these files, and I want to animate a change in the data over thousands of generations.
    But first things first... how do I deal with pixel-by-pixel graphics generation?

    g.setRGB(int x, int y, int rgb) where g is the graphics context of a BufferedImage, for example
    buf = new BufferedImage(width, height, BufferedImage.TYPE_INT_RGB);
    Graphics g = buf.getGraphics();
    g.setRGB(x, y, rgb);
    //or//
    g.setRGB(x, y, new Color(r, g, b).getRGB());
    have fun!

  • Is pixel by pixel painting possible in standard MIDP?

    With pixel by pixel painting I mean painting each pixel on the screen instead of using methods like draweline and drawarc. I know that this is possible when using platform specific Java libraries, like Nokias. But is it also possible to do this in standard MIDP, so it works on all Java-enabled mobiles?

    I assume you mean that there is no such method.No, I mean you should look in the api docs to see if there is such a method (but no, there is none)
    I want to make a fullscreen animation. If I did that
    by calling drawline for each pixel, wouldn't that be
    e terribly slow?Well, just try it. Also, you probably don't need to update all of the screen with every frame

  • How to adjust the green (starting) and the red (end) rectangles pixel by pixel (top, bottom, left and right) by changing the number of pixels in ken burns.

    How to adjust the green (starting) and the red (end) rectangles pixel by pixel (top, bottom, left and right) by changing the number of pixels in ken burns. Help please.

    If you look closely at the top of the canvas pane, as you move either of the boxes (green or red) there is an indication of pixel positions... "top, bottom, left, right," and "scale."
    Admittedly, it doesn't seem as if you can "enter" the dimensions with your keyboard, however, as you move the boxes, you have a real time indication of the boxs' locations.
    (I couldn't take a screen shot, as you have to actively move the box with a mouse or other input device... thus, I could not also take a screen shot with same device.)
    I hope this helps.

Maybe you are looking for

  • One notification on Settings after updating to iOS8?

    Hey guys, I'm having a sort of weird issue with iOS8. After updating, my Settings icon had a notification, and I can't figure out what it's for. I've poked around in the settings and can't see anything that would have triggered the notification. I've

  • Deski reports

    Hi,     Is there any advantage of Deski reports over Webirich  reports? in webirich also we can connect to any type of Datasource and we can do disconnected analysis. still there are any advantages of DESKI over WEBIRICH Reports. please let me know.

  • Disable "nearby printers" in Bonjour

    Here's the problem: I am in a school building with an enormous network. We have an HP Color Laserjet 5550n in our lab; there is an identical Laserjet in another classroom in the building. When people try to print to the color printer in our lab, they

  • Why do I get this error message when connecting?

    hy do I get "iTunes could not backup up iPod because backup was corrupt or not compatible with iPod" when i connect my iPod Touch 4g to iTunes and how do I fix this?

  • Aperture plug in not working

    after updated OS X Mavericks plug in nik software is not working anymore? any suggestion? win