Problem in using PNG files....

Hi everybody...
Whenever i use ImageIo.read(filename) function to read a PNG file....it returns a bufferedImage with Type = 0....
and i cannot use this type of image to perform convolution operations....
how can i solve this??....
Another problem is that whenever i save it using the write method....the size of the new file is way too large than original image.
( ex - 250 kb(source image) - 1.5Mb(saved image))
how can i solve this??
plzz someone help me...
itz urgent!!

I'm making educated guesses here but I suspect you may be loading a palettised (ie <16M color) file and convolution probably requires true color - you can convert by creating a new image and rendering into it.
As for writing out, you can adjust the write settings by tailoring the relevant ImageWriteParams... there should be plenty of info around if you Google.

Similar Messages

  • Two problems in using LKM file to sql

    hi all,
    i met two problems during use "LKM file to sql" for loading data from csv file to oracle db. please try to help me, thanks a lot!
    my environment:
    os: win 7
    odi version: 11g
    The 1st condition is: in the 10th step of the execute session, a table called ".SNP_CHECK_TAB" which could not be created in oracle will be created!
    If i modify it to SNP_CHECK_TABLE, the step will pass...
    why naming table like this?
    create table .SNP_CHECK_TAB
         CATALOG_NAME     VARCHAR2(100 CHAR) NULL ,
         SCHEMA_NAME     VARCHAR2(100 CHAR) NULL ,
         RESOURCE_NAME     VARCHAR2(100 CHAR) NULL,
         FULL_RES_NAME     VARCHAR2(100 CHAR) NULL,
         ERR_TYPE          VARCHAR2(1 CHAR) NULL,
         ERR_MESS          VARCHAR2(250 CHAR) NULL ,
         CHECK_DATE     DATE NULL,
         ORIGIN          VARCHAR2(100 CHAR) NULL,
         CONS_NAME     VARCHAR2(35 CHAR) NULL,
         CONS_TYPE          VARCHAR2(2 CHAR) NULL,
         ERR_COUNT          NUMBER(10) NULL
    The 2nd condition is: i want to filter out certain name in the source table and the filter string is "BRE.name!='some_value'".
    When I clicked the "Testing query" button, the following error shows:"Error while executing query Invalid format description".
    It works well when the source db is oracle, why not file? Is there any format for the filter string in file? I don't think so...
    Jun

    Hi Jun,
    Can i contribute a little for ur 2nd problem.
    This error is coz, If u are using a filter against a File "data store" u can't test it, only against RDBMS query will be tested at data store level.
    Well, for using that filter and make sure its working, drag and drop the source file in the interface (u can get the filter) and make it to execute on STAGING.
    Thanks,
    Guru

  • Using PNG files with transparent background - Please Help

    I just purchased Elements to do a very specific task which I can’t do in Aperture. I am a former photoshopper (V.5) and excited to be back.
    I am doing a book/scrapbook and the majority of my text will be my own handwriting. I use white paper and black ink and I scan in at the highest settings. My goal is to create my handwriting on a transparent background so I can place it in my book as I choose. For this specific project (which is very large in scope) I wanted to keep my image/file management within Aperture.
    So I import my file (of my handwriting) from Aperture and successfully saved with a transparent background. Adobe said I had to save it as a PNG file. I noticed when I saved in Photoshop there was a warning saying I had to save as a copy.
    Aperture does not see the file when I try to import it back. My interchange between aperture and photoshop is fine otherwise. This problem only seems to be with “unflattened” layered images. When I flatten the image it is recognized by Aperture, but I lose the transparent background in Photoshop.
    If anyone sees flaws here or has a suggestion to “isolate” and save my personal handwriting image files I would greatly appreciate it. Thanks!

    Would probably work best if you first export from Aperture as PSD (if possible, like Lightroom) and then save to preserve layers.
    From the PSD save as PNG24 rather than PNG8 which is better for preserving transparency.

  • Problem with the PNG file icon

    Hello. This is the first time I'm posting something here, so please be merciful. :) Yesterday I saw that the file icons of the PNG files are not the blue ones (like we all know them, after installing Photoshop CS3), but the default Windows (I'm using Windows XP SP3) icons. I mean like when I don't have a program to open a given file, that is how it looks like. But when I double click on the PNG file it opens right away, so in my eyes there is a problem, of some kind, with the ICO file itself. The strangest thing is that this ICO file is not missing, deleted or moved! This happened only with the PNG files. All other Photoshop related files are ok and have their respective icons. Can someone tell me how to change the PNG file icon, so I can choose manually the ICO file.

    @roshlioto This is a windows issue NOT Photoshops. So wrong place on the Internet.
    However, you right click on the shortcut/icon whatever, (in Windows) and choose the icon/app you wish to associate with a given file.

  • Automator or Applescript using png files with alpha channel

    I have hundred of png files with alpha channel.
    I want to suppress alpha channel.
    How can i do it using Automator or Applescript ?
    Thank you very much.

    You can use the free command line image processing tool ImageMagick in your Applescripts or Automator workflows, as well as from a Terminal shell.
    You can download ImageMagick from http://www.imagemagick.org, but Cactuslab has simplified installation by putting together an installer package. It’s available at  http://cactuslab.com/imagemagick/. Download the package and double-click on it. Follow the instructions to install. It will install ImageMagick into /opt/ImageMagick and add it to your $PATH by creating a file in /etc/paths.d/. Restart your computer for the changes to take effect.
    The two ImageMagick commands we’re concerned with are “convert” and “mogrify”. Convert is more efficient for multiple and piped operations on the same image file, and mogrify is more efficient for batch processing. Generally speaking, convert will output a file separate from the input file. Unless a path is specified, mogrify will overwrite the input file with the output file. An important distinction.
    You can perform various operations on the alpha channel using arguments after either the convert or mogrify command. Two of the available arguments are:
    -alpha off - Disables the image's transparency channel. Does not delete or change the existing data, just turns off the use of that data.
    -alpha remove - Composite the image over the background color.
    Also of use are the -flatten and -background options:
    -flatten - overlay all the image layers into a final image and may be used to underlay an opaque color to remove transparency from an image.
    -background - sets the background color.
    Start off using the convert command with a single image to see the effect and adjust to your liking. Once you’ve achieved the desired outcome, then use the mogrify command to batch process the chosen images.
    Before getting into how to use Automator or Applescript in your workflow, use Terminal and the command line to see the effect on a single image. Copy one image to your ~/Desktop. In Terminal change the directory to ~/Desktop by typing the following command and pressing the Enter key:
    cd ~/Desktop
    Then choose the option you are looking for, -alpha remove for instance, type the following command and press the Enter key:
    convert input-photo.png -alpha remove output-photo.png
    You can check the alpha channel (transparency) and background in the Preview app, go View > Show Image Background from the menu bar.
    Once you’re ready to batch proces, place all the photos you want to convert with the same command into one folder. Copy the folder to your ~/Desktop. Let’s assume you’ve labeled the folder “InPhotos”. It’s prudent to manipulate copies in case something goes amiss. In that event you can copy the folder with the originals again and start over. Create a new empty folder on your ~/Desktop and call it “OutPhotos”. Let’s also assume your home directory is called “Me”. The following command will process the photos from the InPhotos folder and put them in the OutPhotos folder:
    mogrify -alpha remove -path /Users/me/Desktop/OutPhotos/ /Users/me/Desktop/InPhotos/*png
    According to Apple Technical Note TN2065:
    "when you use just a command name instead of a complete path, the shell uses a list of directories (known as your PATH) to try and find the complete path to the command. For security and portability reasons, do shell script ignores the configuration files that an interactive shell would read"
    So, you need to use the full path to to ImageMagick commands, unlike in the shell where you can just use the command name.
    To batch process using Automator, use the “Run Shell Script” action (note: retain the single space at the beginning of the last line):
    /opt/ImageMagick/bin/mogrify \
    -alpha remove \
    -path /Users/Me/Desktop/OutPhotos/ \
    /Users/Me/Desktop/InPhotos/*png
    To batch process using Script Editor (Applescript), use the “do shell script” command:
    do shell script "/opt/ImageMagick/bin/mogrify -alpha remove -path /Users/pd/Desktop/OutPhotos/ /Users/pd/Desktop/InPhotos/*png"
    Further info on ImageMagick:
    http://www.imagemagick.org/script/command-line-options.php#alpha
    http://www.imagemagick.org/Usage/masking/#remove
    http://www.imagemagick.org/index.php
    http://www.imagemagick.org/script/command-line-tools.php
    http://www.imagemagick.org/script/command-line-options.php
    Examples:
    The original PNG image:
    -alpha off:
    -alpha remove:
    -background black -flatten:
    -background blue -flatten:
    -channel alpha -evaluate Divide 2:
    -channel alpha -evaluate Divide 2 -background black -flatten:

  • Problem on using batch file

    Hi,
    I have an application which reads data from a text and writes them to a database. I should use batch files in my project to work classes with double clicking on them. Java application reads path of the text file from a properties file. I used relative paths like that " ..\\data\\records.txt" for text file path . But my problem is that; when I run application normally it executes. But when I tried to run it from batch file placed build folder(under project folder) it does not work. Because it tries to find the data folder under the build folder. But data folder is under parent folder of build folder. My batch file code is like that :
    SET PATH=%JAVA_HOME%\bin;%PATH%
    SET LIB_PATH=..\lib
    SET CLASSPATH=%LIB_PATH%\mysql-connector-java-3.0.17-ga-bin.jar;..\bin;..\
    java.exe yega.timesheet.MainApplication ..\\configuration\\properties.props
    pause
    Which statements should I add(and where) to make this batch file search for data folder under its parent folder... Please help me.
    Thank you.

    Thanks Paul, but I tried to use cd before running program. I added "cd .." or "cd ..\" lines to batch file but they didn't work. I decided to use absolute path instead of using relative paths. I also found one more solution. I can put a properties file in build too. And define text path as " ..\\data\\records.txt " in this properties file.
    Also I need to use "\\" because "..\\configuration\\properties.props" is the input for args...

  • Unable to import pptx files into key note. Does using PNG file prevent importing slides?

    Unable to import powerpoint files from mail to keynote. Picture files are PNG files. Does keynote not support PNG Files?

    Hi,
    swf files are not supported in Responsive project. swf files should work properly in a non-responsive project.
    Regards,
    Haridoss

  • Problem - Photoshop Saving PNG files too large

    An issue has recently cropped up with Photoshop for me.
    Whenever I try to create a png-24 object using "Save for Web", in the program it will tell me that the file should be only around 1kb, it will end up in the folder 10-15kb, much more than I had intended.
    This has only started happening recently, and when I have asked co-workers to try and export the same psd files using the same method, the exported pngs are the correct 1kb sizes. So the problem is only with my copy of Photoshop.
    Currently I'm running Photoshop 10.0.1 on Windows XP Professional.
    Has anyone else come across this problem, or know how to fix it? I've tried deleting my Preference file, but that didn't correct the issue.

    Please describe the process in more detail (including OS etc.).
    Boilerplate-text:
    Are Photoshop and OS fully updated and have you performed the usual trouble-shooting routines (trashing prefs by keeping command-alt-shift/ctrl-alt-shift pressed while starting Photoshop after making sure all customized presets like Actions, Patterns, Brushes etc. have been saved and making a note of the Preferences you’ve changed, 3rd party plug-ins deactivation, system maintenance, cleaning caches, font validation, etc.)?

  • Webserver Problems when using exe file

    Hey guys I could use some help with a problem I am having.
    I am working with webservers and am trying to stream my program from one computer (server) to another.  I can do this with standalone problems but am having trouble when I try to use an executable.  I have found this article for help:
    http://digital.ni.com/public.nsf/allkb/7F95D43D3F50FCAC8625710E000068E1
    I have included two print screens of the situation.
    1st is my observed stand alone file.
    2nd is my exe file that is showing an error  
    Any help would be greatly appreciated
    Attachments:
    Stand alone Program.png ‏350 KB
    With exe.png ‏87 KB

    Hey dwhamm,
    If the computer that you are trying to use as the server and deploy the executable on does not have the LabVIEW runtime engine that matches the development system, the remote front panel will not operate properly.  Below please find a link on how to build an installer that you should make to include the proper runtime engine:
    http://zone.ni.com/reference/en-XX/help/371361H-01/lvhowto/build_installer/
    There is a note at the bottom of the original tutorial that you referenced on what to be sure to include in the installer. 
    Also, were you able to try changing the URL from http://TargetComputerName/VIname.html to http://TargetComputerIPAddress/VIname.html? 
    Do you have any firewalls on the computer that is being used as the web server?
    Regards,
    Kira T

  • Image is NULL exception, problems displaying a png file

    Hi people,
    I want to display a simple image using j2me on my siemens sl45i emu.
    I'm using the following code to load my png 8x8(created with photoshop, 2bpp) image:
    public void load()
    try
    testImage = Image.createImage("res/enemy1.png");
    catch (Exception e)
    System.err.print("Ladefehler: " + e);
    when I want to display the image using the follwing code:
    private void render(Graphics g)
    g.drawImage(testImage,0,0,0);
    g.drawString("**** you!", 0, 0, Graphics.TOP|Graphics.LEFT);
    I'm getting the following exception:
    java.lang.NullPointerException: Image is null.
    Why do I get this exception when I want to display the image and not when I'm loading the image(something like "couldn't load image..." )....
    I've placed enemy1.png in a folder called "res" in my jar file. Displaying text does work so I don't understand why I can't display an image...
    Any help would be great!
    Thanx in advance, alex

    This can't be possible!
    private void load()
         GameGraphics.getInstance().load();
         Player.getInstance().load();
    I'm printing debug messages in both load()-methods and I'm getting an exception in the player class because gamegraphics didn't finish loading (I can see it from the debugging messages)

  • Problem with using swc files in Flash Player 10

    I have two Actionscript projects in Flex. One is using Flash Player 9 the other is using 10.  Both projects use the fl classes specifically FLVPlayback.
    In the Flash Player 10 project I am using the recently released version 2.5.  Both players use individual controls instead of a complete skin swf.  So the code goes something like video_player.playPauseButton = playPauseBtn.  All the swc files are imported through properties-ActionScript Build Path-Library path-add swc.  This all works great in both projects exept in the Flash Player 10 project the volumeBar swc does not load properly.  In the debug variables for a break point at the function below in FLVPlayback.as the variables handleLeftMargin, handleRightMargin, handleLinkageID and handleY are missing even though they are all in the original fla used to compile the swc.  I have tried compiling swc in both Flash CS3 and 4.  I have tried moving the Actionscript inside the fla files but nothing changes. This leads me to believe it is a bug in the Flash Player 10 or the version 10 playerglobal.swc since this part of FLVPlayback.as is identical in versions 2 and 2.5. The result is that only the volume bar renders but no handle. Debugging all through fl.video.UIManager.as handle_mc remains null?
           public function set volumeBar(s:Sprite):void {
                uiMgr.setControl(UIManager.VOLUME_BAR, s);
    In the Actionscript 9 project all the variables are accounted for so the volume bar and handle render and work fine.

    Further info for anyone who can help!
    I am opening a session from a server via the following sql
    statement:-
    http://servername/virtualdirectoryname?sql=SELECT
    * FROM table1 for XML auto&root=root"
    I only get the popup window when trying it out from our
    webserver?
    The server is MS SQLServer
    The virtualdirectory is created with access set as Windows,
    and always log on set as "myusername" + "mypassword"
    So I thought (hoped) I could pass the "myusername" +
    "mypassword"
    bits into the above sql statement (maybe appended at the
    end?)
    If I type the above sql statement into a browser it works
    perfectly with the xml returned in a web page,
    also as I state above, when I run it from within my flash
    prog on my local machine it runs OK and returns the results into
    the text area specified within the flash prog.
    BUT - When I upload my flash prog to the webserver and try it
    from there, I get a windows popup asking me for username + password
    + domainname.
    any ideas please?

  • Problem on use of files

    Hi all,
    This was the problem i was asked in my exam and i could not think anything on this.plz any body if makes me understand this i will be very thankful.
    Write a program that reads an integer from a file. The initial name of the file
    is known to be "data" but its extension is either "dat" or "txt" or "asc" or nothing.
    In other words the name of the file is either "data" or "data.asc" or "data.txt"
    or "data.dat". The program must systematically try to read one after one.
    Indeed we assume that only one such file exists. As soon as it succeeds it
    should not attempt any more. Then print the number.

    Dear Friends,
    i know that all people on this forum are wonderful and very helpful.
    i don't know why you all are not helping this kid who has posted this prob. and just demanding help.
    plsssssssss just help me.

  • PNG files not displaying - is this a problem in BC / Flexslider2 issue slider too big

    Hi,
    I have uploaded a site dmrural.leapfrogdesign.com.au/index.html and I noticed my png files are not displaying.  Is there a problem with using png files on BC?
    Also I know this is not BC related but I would really appreciate if if someone could tell me how to reduce the size of my flexslider (i am using bootstrap 2.3.2) - it's my first site in bootstrap.
    Thanks,
    Tammy

    They work for me. For example I see the logo on the homepage
    http://dmrural.leapfrogdesign.com.au/img/logo.png
    As for the slider images size you can use something like this:
    .slides {
        max-width: 50%;

  • Lightroom crashes when png fils is used for water mark

    When I use png files, lightroom 5.7 crashes (windows 7 64 bit). With the plug-in Mogrify it works, but not with lightroom itself.The dng fil can be imported into the lightroom catalog without problem. But it cannot be loaded for the identification table (lightroom crashes). I had this issue already in lightroom 4.
    Thanks for any ideas to solve this.

    I opened and resaved the PNG with Photoshop and it didn't crash LR, so it seems your scanner is producing PNGs that aren't quite compatible with Lightroom.
    Instead of me uploading files after editing in Photoshop, you can use an online editor like Pixlr to edit your own PNGs that won't crash Lightroom:
    I used the following steps in Pixlr to convert ABC.png to a transparent background PNG that had black writing then another with white writing:
    Open apps.pixlr.com/editor/ Online Photo Editor | Pixlr Editor | Autodesk Pixlr in a browser, I used IE 11
    Click Open Image from Computer
    Browse to and Open ABC.png
    Double click the padlock symbol in the Layers panel to convert Background to Layer 0
    Select the Magic Wand tool - over at the left
    Turn off Anti-Alias and Contiguous checkboxes up top if necessary because you want all the background removed and clean edges on this B/W PNG
    Click on a white area outside of the letters, notice that the insides of the A and B are also selected because Continuous is turned off
    Hit the Delete (Del) key, notice that the background turns from white to a checkerboard pattern indicating transparency
    Use File / Save... and save this black-letter copy with a new name (e.g.  ABC_black.png) to your computer, somewhere, as filetype PNG - Transparent, Full-Quality
    Use Adjustment / Invert to change the letters to white, notice that the transparency remains
    Use File / Save... and save this white-letter copy with a new name (e.g. ABC_white.png).
    That's it.
    Obviously you can do more things in this editor, but for the simple task of making transparent background PNGs from a scanned PNG that's all you need to do.

  • Can I use mp3 files from different domain as the feed?

    Hi..
    I have just created a new podcast here:
    http://artistsofliving.com/?feed=podcast
    I would like to submit the podcast to iTunes sometime soon...
    However, I'm wondering if they will reject it because the feed lives on 'artistsofliving.com', whereas I keep the media mp3 files on 'livinginthepresent.com'... a different domain.
    I own the mp3 content and both domains- I'm splitting the media from the website for bandwidth reasons.
    Is this ok? If this causes a rejection straight out is there a way to indicate that I own the material fairly?
    Thanks!
    -rich

    There's no problem about using media files from any source: the feed just has to reference them (the URLs have to be 'absolute' - i.e. including the http:// and the server name - even if the file is on the same server as the feed anyway). I don't see the fact that some files have different URLs leading to accusations of copyright breach.

Maybe you are looking for