The invention provides a method for quickly parsing PSD files as web pages. This method is mainly divided into two parts: the parsing of PSD source files and the layer recovery after parsing. For the parsing of PSD source files, this scheme is developed with JavaScript Extension Language. According to the classification of layers in PSD files: Firstly, to parse the text layer of PSD source files, we need to obtain the layer ID, text content, text box location, font size, font color, font type and other information of the text layer. Then the information obtained above is encapsulated in JSON format and finally written into a. TXT file. Secondly, we use the method of layered exporting to parse the common layers of PSD source files. All ordinary layers are exported to PNG format. In addition, we obtain the layer ID and location information of ordinary layers by the above method. For the recovery part of the layer, we developed a background processing platform for processing parsed information. In use, users can restore the original image only by submitting the text information and PNG pictures respectively to the background. The scheme of the invention can transform the PSD file into the web page format more efficiently and avoid the complicated manual cutting process.
【技术实现步骤摘要】
快速解析PSD文件为网页的方法
本专利技术涉及的是快速解析PSD(一种图片存储格式)文件为网页的方法,它是利用图像处理和计算机编程语言解析PSD文件为网页,为了快速便捷的解析PSD文件,而提出的一种高效解析方案。
技术介绍
随着互联网技术的发展,我国网络购物的用户规模不断上升。近年来,随着各大电商平台的强势发展,更是有取代线下实体店的趋势。而随着线上平台的竞争不断增大,卖家如何将自己的商品更好的展现给用户就显得至关重要,我们都知道线上销售不可能像实体店那样直接进行实物展示,卖家只能通过网页的形式让客户去了解商品。目前大多数店铺的网页都是根据客户需求由美工设计好模板,再进行切图,最后把切好的图片提供给技术人员重组到网页上去。这种模式使得网页的可移植性变差,用户如果想要更改就必须依赖美工重新进行设计,对美工的依赖性很大。设想这样一种情景:某一个店铺新进了一批商品,那么对于这些商品的展示是急需的,但是店家只能去找美工定制自己的介绍页面。美工再将设计好的页面提供给技术人员转换成网页的形式。最后,店铺才能使用到。这个过程是繁琐的,而且店铺的成本花销也在无形中增加了。目前美工设计好商品介绍模板之后主要通过图1所示的流程转换为网页格式,这种流程存在的弊端是,在切图部分现在能做到的是通过PhotoShop(一种图片处理软件)提供的切图工具进行切图,然后保存为网页提供给开发人员使用。然后技术人员在使用美工提供的切图的时候还需要考虑美工的设计思路,对图片进行恢复。这样做的结果是美工做了大量的技术人员的工作,而技术人员又做了美工的工作。这就导致整个过程效率低下。
技术实现思路
本专 ...
【技术保护点】
1.一种快速解析PSD文件为网页的方法,其特征在于操作步骤如下:1)PSD文件快速解析;2)将解析文件重建为网页。
【技术特征摘要】
1.一种快速解析PSD文件为网页的方法,其特征在于操作步骤如下:1)PSD文件快速解析;2)将解析文件重建为网页。2.根据权力要求1所述的快速解析PSD文件方法,其特征在于:所述步骤1)PSD文件快速解析的方法为:1-1)对PSD文件进行栅格化操作,并遍历PSD文件;1-2)将PSD文件的所有图层按类型进行分类,包括:图层组,文本图层和普通图层;1-3)对1-2)步骤中的图层进行分类处理,对图层组重复1-2)步骤,对文本图层提取其...
【专利技术属性】
技术研发人员:李晟,杨高强,张新鹏,祝林林,
申请(专利权)人:上海大学,
类型:发明
国别省市:上海,31
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。