Blank File When Saving Image Using Java (LSB Steganography)
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 12 of 12

Thread: Blank File When Saving Image Using Java (LSB Steganography)

  1. #1
    Join Date
    Jan 2014
    Posts
    7

    Question Blank File When Saving Image Using Java (LSB Steganography)

    I was wondering if anyone had any ideas what is going wrong with my LSB steganography application. The problem is that I cannot get a modified image file (with secret text hidden in the LSBs) to save. I have already tested out the algorithm in a small test program using an array of zero bytes (00000000) to hide a small message and it does modify the LSBs as intended. I have also tried to buffer and then re-save an unmodified image - which also works.

    I cannot work out what is going wrong when trying to save it and have already tried various methods (FileOutPutStream, Image.io write) none of which appears to work. It saves successfully but every time it produces a blank image file (the file is the right size, however, when opened is all black and some applications cannot open it at all - does this on all save methods I've tried).

    The program has a class to buffer images/text (Buffer), extract byte data from buffered images/text (GetBytes) and save the modified file (SaveFile). I have included the hide method and algorithm as well as the SaveFile class as I think thats where the problem may be. Please let me know if anymore info/code is needed.

    Below is my code:

    LSB hide method and algorithm
    Code:
    public class LSB_oneBit implements LSB {
     
    //Variables ending in R are for reveal method not yet implemented.
    protected byte[] imageBytes;
    protected byte[] textBytes;
    protected BufferedImage image;
    //protected byte[] imageBytesR;
    //protected byte[] textBytesR; 
     
    protected int offset;
    //protected int offsetR;
    protected int messageLength;
     
    protected SaveFile file;
     
    protected GetBytes imageB;
    protected GetBytes textB;
    //protected GetBytes revealImageR;
     
    protected String dirName;
    protected String imageFileName;
    //protected String imageFileNameR;
    protected String textFileName;
    //protected String messageR;
    protected String saveFileName;
    //protected String saveFileNameR;
     
    //protected OutputStream out;
    protected InputStream in;
     
    public LSB_oneBit() throws IOException
    {
     
    
    }
     
    
     
    @Override
    public boolean hide(String imageFileName, String textFileName, String saveFileName, String dirName, int offset)throws IOException
    {
        this.imageFileName = imageFileName;
        this.textFileName = textFileName;
        imageB = new GetBytes();
        imageBytes = imageB.getImageBytes(imageFileName);        
        textB = new GetBytes();
        textBytes = textB.getTextBytes(textFileName);
        for(byte x: textBytes)
           {
               System.out.println("Text bytes: " + Integer.toBinaryString(0x100 + x).substring(1));
           }
     
        this.saveFileName = saveFileName;
        this.dirName = dirName;
        this.offset = offset;
     
           if(algorithm()!=false)
            {                  
                //All in one way of reading ByteArray.     
                in = new ByteArrayInputStream(imageBytes);
                image = ImageIO.read(in);
                System.out.println("Modified image buffered");
                file = new SaveFile(saveFileName);
                file.writeImage(image);
                return true;
     
                //Method for returning byte[] to SaveFile class instead of bufferedImage
                /*InputStream in = new ByteArrayInputStream(imageBytes);
                //BufferedImage modifiedImage = ImageIO.read(in);
                System.out.println("Modified image buffered");
                file = new SaveFile(saveFileName, modifiedImage, dirName);
                file.writeImage(); 
                return true;*/
     
    
                //Method for writing to file straight from LSB_oneBit class using FileOutputStream
                /*File myFile = new File(dirName,saveFileName);
                System.out.println("Filename is: " + saveFileName);
     
                try 
                {
                    out = new FileOutputStream(myFile);
                } 
                catch (FileNotFoundException ex) 
                {
                    Logger.getLogger(LSB_oneBit.class.getName()).log(Level.SEVERE, null, ex);
                }
                try
                {
                out.write(imageBytes);
                System.out.println("Image file written successfully");
                return true;
                }
                catch(IOException e)
                {
                System.out.println("Cannot save file " + e.getMessage());
                e.printStackTrace();
                e.getMessage();
                return false;
                }
                finally
                {
                out.close();
                }*/
          }
     
       else
          return false;
     
    
    }
     
    public boolean algorithm()
    {
        if(checkSize()!=false)
      {
     
        try
        {
           for (int i = 0; i<textBytes.length; i++)
           {
            int textByteValue = textBytes[i];
            byte textByteValueB = (byte) textByteValue;
            for(int x = 7; x>=0; x--)
            {
             int textBitValue =  ((textByteValue>>>x)& 1);
             byte textBitValueB = (byte)textBitValue;
             imageBytes[offset] = (byte) ((imageBytes[offset]&0xFE) | textBitValueB);
             offset++;
            }
     
           }
     
         System.out.println("Image bytes modified");  
         return true;  
        }
     
       catch (Exception e)
       {
        e.getMessage();
        e.printStackTrace();
        return false;
       }
     }
     else
        {
          return false;
        }
    }
     
    
    public boolean checkSize()
    {
       int imageSize = imageBytes.length;
       System.out.println("Image size is: " + imageSize);
       int textSize = textBytes.length;
       System.out.println("Text size is: " + textSize);
     
       if((textSize*8)<=imageSize)
       {
           System.out.println("Text can fit into the image");
           return true;
       }
       return false;
    }
     
    
     
    }
    SaveFile Class
    Code:
    public class SaveFile {
     
    protected String saveFileName;
    protected BufferedImage image;
    protected BufferedWriter writer;
    protected String dirName;
    //Used for writing byte[] method
    //protected byte[] imageBytes;
    protected File file;
    private BufferedImage bi;
    protected Graphics graphics;
     
    
    public SaveFile(String saveFileName /*String dirName*/ /*byte[] imageBytes*/ )
    {
        this.saveFileName = saveFileName;
        //this.dirName = dirName;
        //this.imageBytes = imageBytes;
    }
     
    
     
    public boolean writeImage(BufferedImage nImage)
    {
        this.image = nImage;
        file = new File(saveFileName);
     
        if (file.exists()== true)
        {
            String stringConfirm = JOptionPane.showInputDialog("File already exists, do you wish to overwrite? Y/N");
            char confirm = stringConfirm.charAt(0);
            if (confirm =='Y')
            {
               try
                {
                 //Method for writing byte[] object
                 /*FileOutputStream output = new FileOutputStream(file);
                 output.write(imageBytes);
                 output.flush();
                 output.close();*/
     
                 //Method for writing BufferedImage object   
     
                  bi = new BufferedImage(515,686, BufferedImage.TYPE_4BYTE_ABGR);   
                  graphics = bi.getGraphics();
     
                  graphics.clearRect(0, 0, 515, 686);
                  graphics.drawImage(image, 0, 0, null);
                  graphics.dispose();
     
    
     
                 //file = new File(dirName);
                 ImageIO.write(bi, "png", file);  
                 System.out.println("Image written to PNG file");
                 return true;
                }
               catch(IOException e)
                {
                 System.out.println("Unable to write image to file" + e.getMessage());
                 return false;
                }
            }
            else
            return false;
         }
     
        else
        {
           try
           {
           bi = new BufferedImage(515,686, BufferedImage.TYPE_4BYTE_ABGR);   
           graphics = bi.getGraphics();        
           graphics.clearRect(0, 0, 515, 686);
           graphics.drawImage(image, 0, 0, null);
           graphics.dispose();    
           ImageIO.write(bi, "png", file);  
           /*FileOutputStream output = new FileOutputStream(file);
           output.write(imageBytes);
           output.flush();
           output.close();
           System.out.println("Image written to PNG file"); */
           return true; 
           }
           catch(IOException e)
           {
           System.out.println("Unable to write image to file" + e.getMessage());
           return false;
     
           }
     
      }
    }
     
    public boolean writeText(String text)
    {
        writer = null;
        try
        {
            writer = new BufferedWriter(new FileWriter(saveFileName));
            writer.write(text);
            return true;
        }
        catch(IOException e)
        {
            System.out.println("Cannot write to file");
            e.getMessage();
            e.printStackTrace();
            return false;
        }
        finally
        {
            try
            {
                if(writer!=null)
                writer.close();
            }
            catch(IOException e)
            {
                System.out.println("Cannot close writer");
                e.getMessage();
                e.printStackTrace();
            }
        }
    }
     
    
     
    }

  2. #2
    Join Date
    Jun 1999
    Location
    SW Missouri
    Posts
    3,438

    Re: Blank File When Saving Image Using Java (LSB Steganography)

    What is a "blank" file? Have you tried comparing the bytes of the original file to the updated file to see what bytes are different?

    How do you execute the code for testing? I don't see a main() method.

    The posted code needs import statements to compile it.
    Last edited by Norm; January 22nd, 2014 at 03:21 PM.
    Norm

  3. #3
    Join Date
    Jan 2014
    Posts
    7

    Re: Blank File When Saving Image Using Java (LSB Steganography)

    Hi, thanks for your reply.

    When I say a blank file, I mean it saves a file, but when opened it is just completely black.

    I have tried tidying up the code to make it a bit clearer and have inserted a main method into the LSB class. I just posted the classes I thought there might be a problem with, but below is the all the classes needed to run (except for the image and text files for testing which can be any really as long as its .png and .txt):

    LSB_oneBit class with main method to run
    Code:
    //import com.google.common.base.CharMatcher;
    
    import java.awt.Image;
    import java.awt.image.BufferedImage;
    import java.io.ByteArrayInputStream;
    import java.io.File.*;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.OutputStream;
    import java.util.Iterator;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.imageio.ImageIO;
    import javax.imageio.ImageReadParam;
    import javax.imageio.ImageReader;
    import javax.imageio.stream.ImageInputStream;
    
    
    /**
     *
     * @author J
     */
    public class LSB_oneBit implements LSB {
        
    
        protected byte[] imageBytes;
        protected byte[] textBytes;
        protected BufferedImage image;
        
        protected int offset;
        protected int messageLength;
        
        protected SaveFile file;
        protected GetBytes imageB;
        protected GetBytes textB;
        
        protected String dirName;
        protected String imageFileName;
    
        protected String textFileName;
    
        protected String saveFileName;
       
        protected InputStream in;
        
        public LSB_oneBit() throws IOException
        {
            
           
        }
    
        
        
        @Override
        public boolean hide(String imageFileName, String textFileName, String saveFileName, String dirName, int offset)throws IOException
        {
            this.imageFileName = imageFileName;
            this.textFileName = textFileName;
            imageB = new GetBytes();
            imageBytes = imageB.getImageBytes(imageFileName);        
            textB = new GetBytes();
            textBytes = textB.getTextBytes(textFileName);
            for(byte x: textBytes)
               {
                   System.out.println("Text bytes: " + Integer.toBinaryString(0x100 + x).substring(1));
               }
            
            this.saveFileName = saveFileName;
            this.dirName = dirName;
            this.offset = offset;
       
            if(algorithm()!=false)
             {                  
                    //All in one way of reading ByteArray.     
                    in = new ByteArrayInputStream(imageBytes);
                    image = ImageIO.read(in);
                    System.out.println("Modified image buffered");
                    file = new SaveFile(saveFileName);
                try 
                {
                    file.writeImage(image);
                } 
                
                catch (Exception ex) 
                {
                    Logger.getLogger(LSB_oneBit.class.getName()).log(Level.SEVERE, null, ex);
                }
                
                    return true;
             }
              
           else
                
              return false;
          
        
        }
    
        
        public boolean algorithm()
        {
          if(checkSize()!=false)
          {
       
            try
            {
              for (int i = 0; i<textBytes.length; i++)
              {
                int textByteValue = textBytes[i];
                byte textByteValueB = (byte) textByteValue;
                for(int x = 7; x>=0; x--)
                {
                 int textBitValue =  ((textByteValue>>>x)& 1);
                 byte textBitValueB = (byte)textBitValue;
                 imageBytes[offset] = (byte) ((imageBytes[offset]&0xFE) | textBitValueB);
                 offset++;
                }
                 
               }
               
             System.out.println("Image bytes modified");  
             return true;  
            }
            
           catch (Exception e)
           {
            e.getMessage();
            e.printStackTrace();
            return false;
           }
         }
          
         else
         
          return false;     
        }
        
        
        public boolean checkSize()
        {
           int imageSize = imageBytes.length;
           System.out.println("Image size is: " + imageSize);
           int textSize = textBytes.length;
           System.out.println("Text size is: " + textSize);
           
           if((textSize*8)<=imageSize)
           {
               System.out.println("Text can fit into the image");
               return true;
           }
           return false;
        }
        
        
        public static void main (String args[]) throws IOException
        {
            //To run the algorithm. 
            //Change directory to where you wish to save modified image.
            LSB_oneBit test;
            
            test = new  LSB_oneBit();
            
            test.hide("image.png", "secret.txt","testImage.png","Desktop", 0);
        }
        
            
    }//End of LSB_oneBit class
    Buffer Class - loads image and text
    Code:
    import java.awt.Graphics;
    import java.awt.image.BufferedImage;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.IOException;
    import javax.imageio.ImageIO;
    
    /**
     *
     * @author J
     */
    public class Buffer {
        
     public Buffer()
    {
    
    }
     
      
     public BufferedImage loadImage(String imageFileName) throws IOException
    {
       File iSource = new File(imageFileName);
       
       BufferedImage image = ImageIO.read(iSource);
       
       try
       {
            return getGraphics(image);
       }
       
       catch (Exception e)
       {
            System.out.println("Unable to read image");
            
            return null;  
       }
       
    }
     
    
     public BufferedImage getGraphics(BufferedImage image)
    {
      
      BufferedImage newImage  = new BufferedImage(image.getWidth(), image.getHeight(), BufferedImage.TYPE_4BYTE_ABGR);
      
      Graphics g = newImage.getGraphics();
      
      g.clearRect(0, 0, image.getWidth(), image.getHeight());
      
      g.drawImage(image, 0, 0, null);
      
      g.dispose();
      
      System.out.println("Image read");
      
      return newImage;   
      
    }
    
    
     public String loadText(String textFileName) throws FileNotFoundException, IOException
    {
        File tSource = new File(textFileName);
        
        BufferedReader reader = new BufferedReader(new FileReader(tSource));
        
        try
        {
            return buildText(reader);
        }
        
        catch (IOException e)
        {
            System.out.println("Unable to read text");
            
            return null;
        }
    }
    
    
     public String buildText(BufferedReader reader) throws IOException
    {
        String text = null;
        
        StringBuffer stringBuffer = new StringBuffer();
        
        while((text=reader.readLine()) !=null)
        {
            stringBuffer.append(text).append("\n");
    
        }
        
        System.out.println("Reading text");
        
        System.out.println(stringBuffer);
        
        return stringBuffer.toString();  
    }
        
    }
    GetBytes Class - retrieves byte[] for loaded image and text
    Code:
    /**
     *
     * @author J
     */
    
    import java.awt.*;
    import java.awt.image.*;
    import java.io.*;
    import javax.imageio.ImageIO;
    
    public class GetBytes {
        
        protected static final int maxIntLength = 4;
        protected static final int datasize = 8;
        
        
        
        public GetBytes()
        {
    
        }
        
        public byte[] getImageBytes(String imageFileName) throws IOException
        {
            
            Buffer bufferImage = new Buffer();
            BufferedImage image = bufferImage.loadImage(imageFileName);
            if(imageByteOutput(image)==null)
            {
              System.out.println("Cannot access image bytes");
              return null;
            }
            else
            return imageByteOutput(image);                
        }
       
        public byte[] imageByteOutput(BufferedImage image) throws IOException
        {
            //ByteArrayOutputStream method for accessing bytes
            byte[] imageBytes;
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            ImageIO.write(image, "png", baos);
            baos.flush();
            imageBytes = baos.toByteArray();
            System.out.println("Image bytes accessed");
            return imageBytes; 
            
            //Raster method for accessing bytes.    
            /*WritableRaster raster = image.getRaster();
            DataBufferByte buffer = (DataBufferByte)raster.getDataBuffer();
            System.out.println("Image bytes accessed");
            return buffer.getData();*/
    
        }
        
    
        
        public byte[] getTextBytes(String textFileName) throws IOException
        {
           
           Buffer bufferText = new Buffer();
           String text = bufferText.loadText(textFileName);
           if(textByteOutput(text)==null)
           {
               System.out.println("Cannot access text bytes");
               return null;
           }
           else
           return textByteOutput(text);
                           
        }
        
        public byte[] textByteOutput(String text)
        {
           byte[] textBytes = text.getBytes();
           byte[] textByteLength = convertToBytes(textBytes.length);
           int totalLength = (textByteLength.length + textBytes.length);
           byte[] total = new byte[totalLength];
               
               
           System.arraycopy(textByteLength, 0, total, 0, textByteLength.length);
           System.arraycopy(textBytes, 0, total, textByteLength.length, textBytes.length);
           System.out.println("Text bytes accessed");
           return total;  
        }
            
        
        
        private static byte[] convertToBytes(int i)
        //Splits an int into the maxIntLength byte array.
        /* java int is 4 bytes in size, so 32 bits. to get each byte into its
         * own seperate array compartment, you first shift the 32 bits by 24 unsigned
         * to the right, leaving the first 8 bits which are anded with 11111111 to get
         * the first 8 bits (anding needed?). Then int i is shifted by 16 unsigned
         * to the right to get the next set of 8 bits, and so forth.
         */ 
           
        {
            byte[] integerBytes = new byte[maxIntLength];
            integerBytes[0] = (byte) ((i >>> 24) & 0xFF);
            integerBytes[1] = (byte) ((i >>> 16) & 0xFF);
            integerBytes[2] = (byte) ((i >>> 8) & 0xFF);
            integerBytes[3] = (byte) (i & 0xFF);
            
            System.out.println("Text length converted to byte[]");
            return integerBytes;
            
             
        }
        
    }
    SaveFile Class - saves modified image
    Code:
    import java.awt.Graphics;
    import java.awt.image.BufferedImage;
    import java.io.File;
    import java.io.IOException;
    import javax.imageio.ImageIO;
    import javax.swing.*;
    
    /**
     *
     * @author J
     */
    public class SaveFile {
        
        
      private File file;
    
     
    
      public SaveFile(String saveFileName) {
    
        file = new File(saveFileName);
    
      }
    
      
    
      public boolean writeImage(BufferedImage image) throws Exception {
    
        return shouldWriteFile() && tryWriteFile(image);
    
      }
    
         
    
      private boolean shouldWriteFile() {
    
        return (!file.exists()) || askToOverwrite();
    
      }
    
     
    
      private boolean askToOverwrite() {
    
        String stringConfirm = JOptionPane.showInputDialog("File already exists, do you wish to overwrite? Y/N");
    
        char confirm = stringConfirm.charAt(0);
    
        return (confirm =='Y');
    
      }
    
     
    
      private boolean tryWriteFile(BufferedImage image) throws Exception {
    
        try {
    
          writeFile(image);
    
          return true;
    
        } catch(IOException e) {
    
          System.out.println("Unable to write image to file" + e.getMessage());
    
          return false;
    
        }
    
      }
    
     
    
      private void writeFile(BufferedImage image) throws Exception {
    
          BufferedImage bi = new BufferedImage(515,686, BufferedImage.TYPE_4BYTE_ABGR);
          
          Graphics g = bi.getGraphics();
                     
          g.clearRect(0, 0, 515, 686);
          
          g.drawImage(image, 0, 0, null);
          
          g.dispose();
          
          ImageIO.write(bi, "png", file); 
    
          System.out.println("Image written to PNG file");
    
      }
    
        
    }
    LSB interface
    Code:
    /*
     * To change this template, choose Tools | Templates
     * and open the template in the editor.
     */
    package Interfaces;
    
    import java.io.IOException;
    
    /**
     *
     * @author J
     */
    public interface LSB {
        
        boolean hide(String imageFileName, String textFileName, String saveFileName, String dirName, int offset) throws IOException;
        
        //boolean reveal(String imageFileNameR, int offsetR, String saveFileNameR);
        
        
        
    }

  4. #4
    Join Date
    Jan 2014
    Posts
    7

    Re: Blank File When Saving Image Using Java (LSB Steganography)

    Quote Originally Posted by Norm View Post
    What is a "blank" file? Have you tried comparing the bytes of the original file to the updated file to see what bytes are different?
    Sorry forgot to answer your question above. Yes, I have tried comparing the original and modified bytes of the image file and the algorithm does as intended and alters the least significant bit.

  5. #5
    Join Date
    Jun 1999
    Location
    SW Missouri
    Posts
    3,438

    Re: Blank File When Saving Image Using Java (LSB Steganography)

    Can you explain the algorithm that the code uses to change the LS bits of the image?
    What happens if the code is modified so it reads an image and writes it out without changing any bits? Does it write a good image file?

    Why are there hard coded values: 515 and 686 in the code? Why isn't the size of the input image used?
    Norm

  6. #6
    Join Date
    Jan 2014
    Posts
    7

    Re: Blank File When Saving Image Using Java (LSB Steganography)

    Quote Originally Posted by Norm View Post
    Can you explain the algorithm that the code uses to change the LS bits of the image?
    first the algorithm checks to if the image bytes are large enough to accomodate the text bytes. For 1 text byte to be encoded, 8 image bytes are needed (1 bit encoded per image byte).

    For (i=0; i<length of textBytes; i++) goes through each byte of the array of textBytes

    textBytevalue = textBytes[i] assigns byte[ i] to textBytevalue

    For (x=7; x>=0; x--) cycles through 8 bits of each text byte

    textBitvalue = textByteValue right shifted by x (cycles through the bits) then anded by 1 (retrieves each bit by AND operation with 1)

    imageBytes[offset position] = imageBytes[offset position] ANDed by 254 (clears LSB to 0) then ORed by textBitValue (inserts LSB of textBytes into LSB of imageBytes)

    adds one to offset to keep cycling through the imageBytes. I've attached a table illustrating inserting text byte 1011011 into 8 image bytes to make it a bit clearer.

    What happens if the code is modified so it reads an image and writes it out without changing any bits? Does it write a good image file?
    If I do not modify the bits (comment out the algorithm body and just have the algorithm method return the non-modified imageBytes), yes it does write out a good image file with no errors.

    Why are there hard coded values: 515 and 686 in the code? Why isn't the size of the input image used?
    that was the width x height of the image I was using. For some reason when I put:
    Code:
          BufferedImage bi = new BufferedImage(image.getWidth() , image.getHeight() ,      BufferedImage.TYPE_4BYTE_ABGR);
    
          Graphics g = bi.getGraphics();
                     
          g.clearRect(0, 0, image.getWidth(), image.getHeight());
          
          g.drawImage(image, 0, 0, null);
          
          g.dispose();
          
          ImageIO.write(image, "png", file);
    it comes up with this error:

    Code:
    java.lang.NullPointerException
    	at SaveFile.writeFile(SaveFile.java:83)
    	at SaveFile.tryWriteFile(SaveFile.java:65)
    	at SaveFile.writeImage(SaveFile.java:35)
    	at LSB_oneBit.hide(LSB_oneBit.java:87)
    	at LSB_oneBit.main(LSB_oneBit.java:170)
    Attached Images Attached Images  

  7. #7
    Join Date
    Jun 1999
    Location
    SW Missouri
    Posts
    3,438

    Re: Blank File When Saving Image Using Java (LSB Steganography)

    In describing the algorithm I don't see how does the program changes only the contents of the image's bytes and not change the image file's other contents like the control and format bytes?
    Norm

  8. #8
    Join Date
    Jan 2014
    Posts
    7

    Re: Blank File When Saving Image Using Java (LSB Steganography)

    Yes it just changes the bytes, the format was suppose to stay the same as PNG. Would it have to change these other contents to save successfully?

  9. #9
    Join Date
    Jun 1999
    Location
    SW Missouri
    Posts
    3,438

    Re: Blank File When Saving Image Using Java (LSB Steganography)

    Quote Originally Posted by nextheaven View Post
    Yes it just changes the bytes,
    Then it destroys the image file's control bytes so it is not a valid image file. The code should only change the bytes that have the pixels color values.
    Norm

  10. #10
    Join Date
    Jan 2014
    Posts
    7

    Re: Blank File When Saving Image Using Java (LSB Steganography)

    Quote Originally Posted by Norm View Post
    Then it destroys the image file's control bytes so it is not a valid image file. The code should only change the bytes that have the pixels color values.
    Ah I see. I didn't know that. So I am guessing I need to find a way to cycle through red, green and blue pixel bytes and change only them?

  11. #11
    Join Date
    Jun 1999
    Location
    SW Missouri
    Posts
    3,438

    Re: Blank File When Saving Image Using Java (LSB Steganography)

    One technique I've seen is to create a BufferedImage of the correct type (TYPE_INT_ARGB) and use the getRGB() method to get the image's pixel colors.
    Norm

  12. #12
    Join Date
    Jan 2014
    Posts
    7

    Re: Blank File When Saving Image Using Java (LSB Steganography)

    Quote Originally Posted by Norm View Post
    One technique I've seen is to create a BufferedImage of the correct type (TYPE_INT_ARGB) and use the getRGB() method to get the image's pixel colors.
    Ah ok. I will give that a shot. Thank you very much for your help, you've been great!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center