Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Add large data chunk in a .PNG image using C#

Posted on 2013-11-01
5
Medium Priority
?
952 Views
Last Modified: 2013-11-17
Hi,

I need some opinion and tips. We are having a "drawing tool" that save to .png file but now we need to keep track of some vectorial data.

We get in the idea of adding a "data chunk" but we are note familiar with the format itself. We found that Adobe fireworks seem to do that kind of trick. Defining our own file format get things more complicated and lot less user firendly, the file cannot be emailed and need to "teach" file format differences.


- Do you find this an acceptable solution?
- Any tips or c# library that can help to add and reread our data insinde the png
- Any chunk size limitation?

Thanks
0
Comment
Question by:TelDig
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
5 Comments
 
LVL 16

Expert Comment

by:hjgode
ID: 39619093
I would not go with a new format. You may either select one of the compound graphic file formats, like EPS, or, what I prefer, save the vector data in a separate file with the same name.
To save the vector data, you need to keep an array of drawing commands and then 'translate' these commands to svg, eps or similar drawing file.
If you can translate the drawing to eps (postscript) you may also use a pdf file for export/import, see the iTextSharp library.
0
 

Author Comment

by:TelDig
ID: 39622541
The issues here is that we must keep a flat image format (ex: png or jpeg)
0
 
LVL 16

Expert Comment

by:hjgode
ID: 39623394
You cannot use a bitmap file to store vector data. So either you go with two files (most comaptible) or hybrid file format (pdf) or possibly add your drawing data at the end of the png/jpg file. I do not know, what happens with apps, when they open a file with added file data at end of normal file.
0
 

Accepted Solution

by:
TelDig earned 0 total points
ID: 39642497
The PNG file format have been designed such way.

You can add additionnal data chunk that will be invisible to other applications. (they call that Ancillary chunks) Some are defined but you can create your custom/private chunk. whey will be ingnored from decoder

We have performed a small prototype using this library : https://code.google.com/p/pngcs/

- It worked well. even with an extra 20MB of "junk"
- Lots of tool that compress/shrik png file will strip all those chunk to keep only the image
- We assume that good chance a user that open the file in an editor will will remove our data but it's what we prefer anyway.
0
 

Author Closing Comment

by:TelDig
ID: 39654326
My question / My answer
0

Featured Post

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article provides the solution to a question (http://www.experts-exchange.com/Software/Photos_Graphics/Images_and_Photos/Q_28674207.html) posed here at Experts Exchange. The asker of the question has many JPG images in many folders, and all of t…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
The goal of the tutorial is to teach the user what gradient filters are and how to use them. When you have a photo and some part of the photo is either over exposed or under exposed, you use a gradient filter to help mask the need to touch up th…
The goal of the tutorial is to teach the user the full work flow of how to use flash media encoder to stream onto YouTube.
Suggested Courses

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question