Save 32 bit signed array as a png file

I am trying to save a 32 bit signed 2d array as a png file in labview. I have the data save as a .csv, but the file sizes are extremely large, so I was hoping to switch to another format to save space (must be lossless).
I have tried converting the array into a pixmap and then using the imaq functions, but that did not work.
Any help would be greatly appreciated.

Assuming you have the ASCII values of the 32 bit values, that can be up to 12 bytes per value including delimiters. Just saving it as a binary file could chop two-thirds of the size. Let's say there is some order to the data so compression may help, in this case I would simply zip it. The primary compression of PNG comes from the same Deflate algorithm used by zip (with only minor differences). Line drawings often have regions whose value is the same across several rows. PNG adds a pre filtering step which makes regions like these more friendly to the run length encoding used by Deflate. If your data does not have this feature, you will not gain much with PNG versus zip. Some PNG encodes skip the filter altogether, leaving you basically with a rube Goldberg method of zipping files.

Similar Messages

  • I would like to know how i can save an byte array to a mat file format (matlab file format '*.mat') within to use the matlab API

    So, I search the binary matlab file format('*.mat').

    Title:
    Moving Data Between MATLAB® and LabVIEW
    Problem: 
    How can I share data between LabVIEW and the MATLAB environment?
    Solution: 
    MATLAB users can move data between the
    MATLAB environment and LabVIEW, you have several options. Prior to
    LabVIEW 5.1, the only way to transfer data between these two
    environments was to use the Save and Load functions. Those are discussed herein.
    Beginning
    in LabVIEW 8.0, MathScipt was introduced. MathScript is an integrated
    part of LabVIEW that you can use to combine intuitive graphical
    dataflow programming with math-oriented textual programming. See the
    attached links below for more information on MathScript.
    Beginning
    in LabVIEW 5.1, the MATLAB script node was introduced into the LabVIEW
    programming environment. The MATLAB script node makes ActiveX calls to
    the MATLAB software from within LabVIEW. This requires that both MATLAB
    be installed on the same machine and that a valid license is obtained.
    More information on the MATLAB script node can be found in the attached
    KB's.
    For all versions of LabVIEW, this data transfer can be
    performed by saving the data in a file using the MATLAB software and
    reading it directly from LabVIEW, or vice versa. In the MATLAB
    environment, the command "save" allows you to save the data in
    binary format (*.mat) or ASCII format. You also have an option of
    saving it in ASCII format using a tab delimiter between data points and
    the command "load" allows you to read in the data.
    ASCII Format
    Complete the following steps to import or export data between LabVIEW and the MATLAB environment using an ASCII file format.
    From the MATLAB environment to LabVIEW
    To save a vector or a matrix X in tab-delimited ASCII format, enter the following in the command window or m-script file in the MATLAB environment:
    >>SAVE filename X -ascii -double -tabs
    This creates a file named filename containing data X in tab-delimited ASCII format.
    Import the file into LabVIEW using the Read From Spreadsheet File VI located on the Functions»File I/O palette.
    From LabVIEW to the MATLAB environment
    To export a matrix X from LabVIEW to the MATLAB environment, first save the data in ASCII format in LabVIEW using the Write To Spreadsheet File VI on the Functions » File I/O palette.
    Enter the following in the command window of the MATLAB environment, or in the m-script file:
    >> LOAD filename
    This reads the data into the MATLAB environment.
    Binary Format
    Complete the following steps to import or export data between LabVIEW and the MATLAB environment.
    From the MATLAB environment to LabVIEW
    As mentioned above, LabVIEW does not save multiple variables to one
    data with extra manipulation, and will not be discussed here.
    Therefore, the only way of sending the data from the MATLAB environment
    to LabVIEW without tampering with the MAT binary file structure is
    using the ASCII format. Also, please bear in mind that you need to have
    one file for one variable.
    From LabVIEW to the MATLAB environment
    Because
    the MATLAB software saves data in its own binary format, the "MAT"
    file, binary LabVIEW data must be converted to this format prior to
    transferring the data. The attached examples can be used to save
    LabVIEW data in the MATLAB software format. The convenience of the .MAT
    file format is that more than one variable can be saved in the same
    file. The example shows saving seven variables to .MAT format; the
    example can be modified for any number of variables.
    Once this data is saved from LabVIEW, it can be read into the MATLAB environment, using the following command:
    >>LOAD filename
    The Who
    command can then be used to display all the seven variable names, and
    you can display the content of them by entering the variable names at
    the command prompt as usual.
    MATLAB® is a
    registered trademark of The MathWorks, Inc. Other product and company
    names listed are trademarks and trade names of their respective
    companies.
    | Michael K | Project Manager | LabVIEW R&D | National Instruments |

  • How to save data (DBL array) in a excel file

    Ok, I am new into Labview.  This question may seem easy for you guys, but for me, it is quite a challenge.  I have current coming out of a loop.  When the program stop, I would like to be able to save it as well as the time when it has been taking and the average current in a excel file.  When my labview code stops, how do I do to get a  pop up window which ask me where and what name to save it to? How do I get so that on the top of each column, it says : current (Amp)    Time (ms)   Average Current (amp)?
    thank you very much,

    Hello,
    We love to see people catch the LabVIEW spirit and anything we can do to help
    you through the initial learning process is our pleasure.
    As KC suggested saving the file as a .csv is a good idea,
    you can also save it as a txt file and open it with Excel specifying a delimiter
    for the columns.
    There is a really good example you can find in the LabVIEW
    example finder if you search for the keyword ‘file’, the example is called “Write
    to Text File.vi”. They use a Get date/time String to record the time when data
    is acquired.
    I have attached a simple Write to File picture of a VI that
    takes a random number and writes it to a file. When I run the VI, a popup asks
    me what I want to call the file. The first part writes the heathers on the
    columns and inside of the for loop I save the data. Underneath the block diagram
    is a picture of the output file when I specify the number of samples to be five.
    If you want your file to be on a very specific format, you
    can create a template file, read it in LabVIEW, and then add your data to it
    and save it to a new file.
    Hope this can get you started with your program.
    There are a lot of good tutorials online on how to
    get started using LabVIEW. Here is the link to a three hour
    introduction course:
    http://zone.ni.com/devzone/learningcenter.nsf/03f7c60f17aad210862567a90054a26c/60c2782788a811c986256cd50001a0a6?OpenDocument&node=200067_us
    We are also comming out with LabVIEW 8 in November and we have a program called LabVIEW Standard Service Program
    (SSP) that allows you to get automatic upgrades and updates. Please let
    me know if you are interested in knowing more about it.
    Good luck,
    Tica Taveras
    Applications Engineer
    National Instruments
    Attachments:
    SaveData.bmp ‏1475 KB

  • Why can't I save as my photoshop cs4 file to .png file? I don't see any option now?

    Hi,
    why can't I save as my photoshop cs4 file to .png file? I don't see any option for saving .png in Save As diolog box now? It was working fine until yesterday. Neither I can open a .png file nor save my psd file to png file?
    Please help. I am using Microsoft Window XP Professional and Photoshop CS4.

    In Photoshop CS4, .png open/save support was provided by a plug-in.  It is possible the plug-in has been deleted or moved, or has become unavailable to Photoshop because of a change in file protections.
    Do you have the file PNG.8BI on your system.  It should be here on a 32 bit Windows system:
    C:\Program Files\Adobe\Adobe Photoshop CS4\Plug-ins\File Formats\PNG.8BI
    -Noel

  • How to create PNG file from byte array of RGB value?

    Hi
    Here is my problem.
    I have drawn some sketchs (through code in runtime) on canvas. I have grabbed the RGB information for the drwan image and converted to byte array.
    I have to pass this byte array to server and generate a png file and save.
    Please help.

    {color:#ff0000}Cross posted{color}
    http://forum.java.sun.com/thread.jspa?threadID=5218093
    {color:#000080}Cross posting is rude.
    db{color}

  • Photoshop CC saves PNG files bigger than some PNG-specific tools

    Hey,
    as a web-developer i'm working with PNG files alot. Since the release of Photoshop CC i always need to go back to CS6 for saving what i did in CC. I thought maybe it's just an early bug which will be fixed soon but still nothing and annoying. Maybe i missed something and there is a benefit in this bigger files? So here is a short discription...
    When saving a PNG file
    ( file > save as > PNG > Compression: Smallest/Slow and Interlaced: None )
    the files saved in Photoshop CC are about 17kb bigger compared to the saving in Photoshop CS6
    A former 0,3kb PNG file gets saved with 17kb in Photoshop CC.
    I use the English Windows 64bit Version of Photoshop CS6 and CC.
    A fix would be very appreciated.
    Screenshot of both files:
    Thanks,
    Bye!

    Chris and Idothings:
    Here's a quick example that explains what I am talking about:
    Download this 32bit png, and open in Photoshop:
    http://www.estructor.biz/testje/heading.psd
    In Photoshop, the only options in the save for web dialog I have for png are these:
    and
    Since I require the alpha channel to remain intact, I am forced to export to a 32bit png (png-24 with transparency checked). Png-8 would be a much better choice, since this image could be optimized with a limited colour palette, but Photoshop does not allow a full alpha channel to be included in that case. In short, a pixel's transparency is either on or off in 8bit png mode.
    In Photoline I can choose a png with 32768 colours and full alpha transparency. This reduces the file size while I retain full visual quality.
    Fireworks offers us an additional option:
    Png 8 bit with Alpha Transparency. This gives us the power of full transparency and a limited index-based colour pallette. It also results in a much reduced file size.
    Unfortunately, Fireworks' colour reduction algoritms are quite old, and you cannot really choose 128 colours: it wrecks the quality (in this case, at least). With manual colour choices this could be improved, but the time this would take kinda defeats the purpose of having a web optimization tool.
    One other disadvantage to Fireworks: no further development. Adobe killed it.
    Often 256 indexed colours are not enough. Color Quantize goes one step further, and allows for a limited colour palette of 512, 1024, 2048 and 4096:
    This gives a web front end developer an incredible control over a limited colour palette, and yields the best balance between file size and visual quality, while retaining a full alpha channel. Color Quantizer also includes a very simple quality mask brush tool to paint over areas that must remain identical in quality.  The colour reduction algoritms are top-notch, so with the sample image even 128 colours are visually quite acceptable.
    Final results:
    Photoshop: full 32bit png - 254kb
    Photoline: 32768 colours 32bit png - 207kb
    Photoline: 256 colours 32bit png - 170kb
    Fireworks: 256 colour 8bit png + 8bit alpha channel - 54kb
    Color Quantizer: 256 colour 8bit png + 8bit alpha channel: 50kb
    Color Quantizer: 128 colour 8bit png+ 8bit alpha channel: 41kb
    Do I really have to explain any further? You'd have to be mad as a hatter to continue to use Photoshop for png optimization once you start to realize how limited its png output options are. Luckily, Color Quantizer (and ImageAlpha for mac) is completely free: so export to a 32bit png, and optimize in those.It will save a LOT of bandwidth.
    Chris, you are correct in stating the png export options have not changed since v5.5 - it shows. Photoshop is stuck in the nineties as far as web export is concerned.
    Oh, and one more thing: Photoline, Color Quantizer and ImageAlpha offer a wealth of dithering algoritms. While Photoshop users are limited to diffusion, pattern and noise, in Color Quantizer I have six different options plus other options to control the final colour reduction.
    PS I could not check ImageAlpha for the mac, since I work on a WIndows machine at home. In my classes I do demonstrate ImageAlpha to the students, and it gives comparable results to Color Quantizer (since both use, I believe, the same colour reduction algoritms) at a low 128 colours. I recall a file size of around 46kb.

  • How do you open and save PNG files as images rather than a document (which my MacBook is doing automatically)?

    Hi,
    Basically I'm doing a course in which i need to import images on a document for evidence (in particular Cirque Du Soleil, yes it's a weird course!) I am using the develop menu tab and using the Inspect Element menu. Here i have found loads of images that are perfect for my evidence, but the images are all showing as PNG files. Whenever I try to save these they will only save as Documents and not images. How can I change this so I can save them as images and import them imto Pages.
    Many Thanks
    Mason

    Hi @Shootist007
    I knew PNG files were image files, that why i was confused when I saved them onto my Mac they were showing as Documents under file type. But i managed to do via Preview (opened it up in Preview then click and dragged to my document).
    Thanks for your help

  • How do I save a word pdf file to png file for up load onto FB

    how do I save a word pdf file to png file for up load onto FB

    What is a Word PDF file? There are Word files and there are PDF files. What does your question have to do with Boot Camp, the subject of this discussion group?

  • How do I save a PNG file with an alpha channel in Photoshop CS5?

    I have a PNG file created in Photoshop and I need to save it with an alpha channel for web purposes. I tried 'Save for Web & Devices' and selecting the Transparent box. Then, after saving, when I select 'get info' for the file it says there is no alpha channel. I'm stumped I can't seem to create an alpha channel from within Photoshop while I'm editing. Help!

    If you save as a 24bit png with transparent checked photoshop will save the png with transparent background (ie alpha transparency).  The png will appear transparent in a web browser.

  • Can't open or save png files

    Hi, I'm very new to fireworks and since I installed it 4
    weeks ago I can't save or open png files. An error message appears
    stating An internal error occurred. I've read through other posts
    and because fonts kept coming up It needed doing anyway, I ran a
    clean install of my os, still no luck. All other file types are
    fine.
    Mac G5 - 10.4.9 running studio 8
    Any help with this would be much appreciated.
    Thanks.

    My OS is 10.4.11. on 2 GHz Intel iMac.
    I reread my orignial post and noticed a typo. I can save png's with PS "save for the web," but can't open those just-saved png files.
    I did lots of things before I noticed that the png wasn't working. Don't know which may have caused a problem. Likely things? Well, I added a plugin for Ico. format. I deleted it because I thought it might have caused the conflict.
    Assuming that was the problem, what can I do to restore the png file format?
    I don't have disk warrior. I did run the maintenance utility yesterday. It runs crons, clears caches, deletes cookies, that kind of stuff.
    I've never had a problem with it disabling plugins or causing any problems. Haven't run disk utility for a few weeks. Would that help?
    I didn't download the replace png plugin from Adobe, but the original wasn't working anyway. I looked for a backup on the exernal drive, didn't find one, and downloaded another.
    Next, I did a Photoshop reinstall thinking that might fix the problem, but it didn't.  Which plugin folder should the png plugin be place in. I've never been sure why there are two format folders;  the folder in plugins, and the folder in Photoshop only.

  • .png files open in browser even though I have set prefs for .png files to "Always ask" instead. How fo I force Firefox to save .pngs and not open in browser?

    Forefox will not download or ask me to save .png files even though I set that file extension in Prefs -> Applications dialog box to be "Always ask"
    I have to be able to donwload and save .png files and I can't do that if they load in a browser window.

    I find it odd that the browsers on the Android platform can't support this on their own. I know that Google Chrome on it's full blown version for the PC is able to do so without using the Adobe software for the embedded PDF aka using "The Adobe PDF Link Helper" . I would love to see this change especially since I prefer Firefox over other browsers.

  • Hi. I'm using illustrator cs6 on pc. I've made a scientific figure for a paper and now I'm trying to export as a png or save for microsoft office. Despite my figure being in the middle of my artboard, it always comes out bottom left in the png file or jpg

    Hi. I'm using illustrator cs6 on pc. I've made a scientific figure for a paper and now I'm trying to export as a png or save for microsoft office. Despite my figure being in the middle of my artboard, it always comes out bottom left in the png file or jpg. Must be making a school boy error! Please help!

    In similar cases, my solution is to "select all" then "deselect" only the artwork I want to keep and "delete". If I'm curious I may "cut" then "paste" to see what shows up in the center of the screen. it is usually some stray point. or other element out direct sight.

  • How to save a 4D Array in a File and load it later on?

    Hello,
    I am trying to save a 4D Array (Array[4000] [3] [20] [5]) of UINT in a File. I can do it through "write in binary File". But then I can´t load it. I know I can transform my Array down to 1D Array of 1.200.000 Elements (4000*3*20*5) of UINT. When I load it, I have to transform it back (with a lot of "for-looping") back to 4D. But is there an easier way of doing that?
    I was not able to find a solution in this forum - I am sorry if I made a new thread if there is already a solution in this forum.
    Best regards
    LabVIEW 2011
    Solved!
    Go to Solution.

    As Lynn said, there should be no extra code required.
    When writing, make sure that "prepend size" is true (true is default) and when reading, wire an empty 4D array of the correct representation to the "data type" input.
    (I also assume that your LabVIEW version is not extremely ancient)
    LabVIEW Champion . Do more with less code and in less time .

  • TS3276 Having trouble sending jpeg images as attachments in Mac email.....they go thru as images and PC users can't see the SAVE or QUICK LOOK boxes that Mac mail has.  One friend scrolled over the image, right clicked on it and saved as a PNG file.

    Having trouble sending jpeg images as attachments in Mac email.....they go thru as images and PC users can't see the SAVE or QUICK LOOK boxes that Mac mail has.  One friend scrolled over the image, right clicked on it and saved as a PNG file.

    Apple Mail isn't going to change the format of any of your attachments. it isn't going to corrupt them either.
    Exchange is a transport protocol and server. The issue you describe is not related to Exchange.
    There are many different versions of Microsoft Outlook in use and they all have e-mail bugs. Different versions have different bugs. Some Apple Mail hack to get around a bug in Outlook 2003 may cause the same message to be problematic in Outlook 2000. Fix them both and another issue will cause trouble in Outlook 2007. You can't fix this. Apple can't fix this. Microsoft can and has but that is irrelevant if your recipients are using older versions.
    One specific problem is that Apple Mail always sends image attachments inline, as images, not as iconized files. You can change this with Attachment Tamer. Just be aware that use of this software will break other things such as Stationery. E-mail is just a disaster. To date, no one outside of Apple has ever implemented the e-mail standards from 1993. Apple has continually changed its e-mail software to be more compatible with the de-facto standards that Netscape and Microsoft have unilaterally defined and people documented as "standards" after the fact. The e-mail messages that Apple Mail sends are 100% correct and do not violate any of the original standards from 1993 or the Microsoft/Netscape modifications. The problem is entirely bugs and limitations in various versions of Outlook.

  • I have used Image Capture to scan images/documents and then saved them as either PDFs or PNG files.  For some reason, just this past week Image Capture will no longer save the file.  It scans, and the Scan Results window pops up, but it won't save file.

    I have used Image Capture to scan images/documents and then saved them as either PDFs or PNG files.  For some reason, just this past week, Image Capture will no longer save the file.  It scans, and the Scan Results window pops up, but it won't save file.
    The file name has no special character in it, just letters and no spaces.
    I have done this in the past and it has worked, but now it will not.
    I have not upgraded any software, that I am aware of.
    After scanning, the Image Capture pops up the Scan Results with the file name in the window, but neither the Scan Results nor the Image Capture window responds to inputs.  The Image Capture window is frozen, with only the "Overview" and "Cancel" buttons active (but non-responsive).
    Is this a software issue or a scanner hardware issue?  I am using a HP Photosmart C6200 series printer/scanner on a network using a Time Capsule airport.
    Thanks.

    I had the same problem.
    Got a 90% fix.  Apparently the Mavericks preferences won't work with Yosemite, so I just deleted the Image Capture preferences.
    Unfortunately, the "Scan to" folder seems to be permanently set to the Pictures folder.
    1.  Quit Image Capture
    2.  Go to Finder > Go > Home, which opens up your home folder (named after your user name)
    3.  Open Library > Preferences > com.apple.ImageCapture.plist - Drag this file to the Trash
    4.  Start "Image Capture", click "Details" and change all your settings as you prefer
    5.  Quit and restart "Image Capture".   Notice it remembers all your settings except "Scan to" folder.  It insists on saving to "Pictures".
    That's as far as I was successful.  I tried changing the "Scan to" folder to "Desktop", but on launch, Image Capture always sets it back to "Pictures".
    This is what I tried:
    6.  Download and install "Pref Setter" from http://www.nightproductions.net/prefsetter.html
    7.  Quit "Image Capture".  Right-click on "com.apple.ImageCapture.plist" and open with Pref Setter.
    8.  Search for "Pictures", which finds "~/Pictures" (the tilde character at the start means your home directory).
    9.  Double-click on "~/Pictures" and change it to the folder you prefer.  I like "~/Desktop"
    10. Choose File > Save then Quit from Pref Setter.  Note that re-opening the plist file still shows "~/Desktop"
    11. Start up "Image Capture" -- on startup, "Image Capture" sets "Scan to" folder to "Pictures"
    I consider this a bug.

Maybe you are looking for