烟花PNG格式,有什么见解?任何libs? [英] The fireworks PNG format, any insight? Any libs?

查看:143
本文介绍了烟花PNG格式,有什么见解?任何libs?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最终目标是将fireworks png文件中的页面导出到单个图像。所以我有几个问题:

The ultimate goal is to export the pages in a fireworks png file to individual images. So I have a couple questions:


  1. 你知道吗 - 库,应用程序 - 已经这样做了吗?

  2. 您对格式有任何信息吗?我假设他们将信息存储在专门的块中。我只是希望那些块的有效载荷的格式不是那么难以理解。

我没有挖任何烟花文件呢。我没有找到关于格式的信息,所以这是下一步,但我想有人可能会知道一些并节省我一些时间:)。

I have not dug into any fireworks files yet. I am finding no information on the format, so that is next step, but I figured someone may know a bit and save me some time :).

我希望(也可能不是这样)是每个页面都以不同的IDAT块的形式存储为PNG。但是,由于矢量功能,不太可能。也许他们将svg格式存储在块中?

What I hope (and probably isnt the case) is that each page is stored as PNG in separate IDAT chunks. Unlikely, though, due to the vector capabilities. Maybe they store svg format in the chunks?

任何帮助或讨论都表示赞赏。我计划在接下来的几天内深入研究这个问题。

Any help or discussion is appreciated. I plan to dig into this in the next couple days.

Ben

编辑:这里有几件事:下面链接的超级用户帖子表示文件是APNG。烟花文件不是APNG。 APNG包含动画块:acTL,fcTL,fdAT。除了IDAT块之外,Fireworks还有prVW,mkBF,mkTS,mkBS,mkBT块,但没有APNG块。

Here are a couple things: the linked superuser post below indicates the files are APNG. fireworks files are not APNG. APNG contains animation chunks: acTL, fcTL, fdAT. Fireworks has, in addition to the IDAT chunks, prVW, mkBF, mkTS, mkBS, mkBT chunks but none of the APNG chunks.

这里有关于烟花PNG的非常可靠的帖子: http://newsgroup.xnview.com/viewtopic.php?f=35&t=20592#p86243

There is a pretty solid post here on fireworks PNGs: http://newsgroup.xnview.com/viewtopic.php?f=35&t=20592#p86243

所以我想我需要知道这些块做了什么,以及如何解析它们。

So I suppose I need to know what these chunks do, and how to parse them.

推荐答案

有趣的问题。

如果您正在尝试编写一个获取Fireworks PNG(APNG)并保存页面的实用工具,那么它不会有多大帮助,但这里有:

Don't how much it helps, if you're trying to write an utility that gets a Fireworks PNG(APNG) and saves the pages, but here goes:

您可以使用Fireworks中的导出菜单:文件>导出>页面到文件

You could use the Export menu in Fireworks: File > Export > Pages to Files.

您也可以使用另存为选项并选择 Photoshop PSD
此选项将页面保留为Photoshop图层面板中的文件夹/组,
,但它会栅格化矢量形状。如果你想解析
a PSD
而不是APNG,它可能会很方便(访问图像,页面)。

Also you could use the Save as option and choose Photoshop PSD. This option preserves the pages as folders/groups int the Photoshop Layers Panel, but it does rasterize vector shapes. Still, it could be handy if you want to parse a PSD instead of a APNG(to access images,pages).

我已经整理了一个小脚本(主要使用 docs )将您当前打开的Fireworks PNG的PSD保存到您选择的文件夹中:

I've put together a small script (mostly using the docs) which saves a PSD of your currently open Fireworks PNG to a folder you choose:

var doc = fw.getDocumentDOM();
var loc = fw.browseForFolderURL("select a folder to save pages");

var prevWarn = fw.getPref("PsdExport_Warn100"); // bool 
fw.setPref("PsdExport_Warn100", false);    // don't warn. 

var kObjToLayer = 1; 
var kFlatten = 2; 
var prevLayers = fw.getPref("PsdExport_Layers"); 
fw.setPref("PsdExport_Layers", kObjToLayer);    // flatten layers or not. 

var kEffectEditable = 1; 
var kEffectRender = 2; 
var prevEffects = fw.getPref("PsdExport_Effects"); 
fw.setPref("PsdExport_Effects", kEffectEditable); 

var kTextEditable = 1; 
var kTextRender = 2; 
var prevText = fw.getPref("PsdExport_Text"); 
fw.setPref("PsdExport_Text", kTextRender); 

if(loc) fw.exportPSD(doc, loc+"/yourPages.psd"); 

// Put the prefs back. 
fw.setPref("PsdExport_Warn100", prevWarn); 
fw.setPref("PsdExport_Layers", prevLayers); 
fw.setPref("PsdExport_Effects", prevEffects); 
fw.setPref("PsdExport_Text", prevText);

如果将其保存为.jsf文件,并在Fireworks中打开文档,则应该是能够双击.jsf文件。

If you save this as a .jsf file, and have a document open in Fireworks, you should be able to just double click the .jsf file.

另外,注意到导出PSD扩展可用,这里有比我的小脚本更多的选项。

Also, noticed there's an Export PSD extension available, which has more options than my little script here.

如果您需要矢量形状,可以使用文件导出> FXG和图像,然后选择所有页面格式。 FXG是一种xml格式,并且可以使用规范

If you need the vector shapes, you can use File Export > FXG and Images and choose All Pages bellow the format. FXG is an xml format, and the specs are available.

HTH

这篇关于烟花PNG格式,有什么见解?任何libs?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆