资源简介
GIMP 2.6 图像 处理 软件
代码片段和文件信息
#!/usr/bin/env python
# Gimp-Python - allows the writing of Gimp plugins in Python.
# Copyright (C) 2003 2005 Manish Singh
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not write to the Free Software
# Foundation Inc. 59 Temple Place - Suite 330 Boston MA 02111-1307 USA.
import string
import struct
import inspect
import os.path
import gimp
from gimpfu import *
gettext.install(“gimp20-python“ gimp.locale_directory unicode=True)
(CHARS_SOURCE CHARS_FILE CHARS_PARAMETER) = range(3)
escape_table = {
‘&‘: ‘&‘
‘<‘: ‘<‘
‘>‘: ‘>‘
‘“‘: ‘"‘
}
style_def = “““body {
width: 100%%;
font-size: %dpx;
background-color: #000000;
color: #ffffff;
}
“““
preamble = “““ “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd“>
tle>CSS Color XHTML written by GIMP tle>
%s
ta http-equiv=“Content-Type“ content=“text/html; charset=utf-8“ />
“““
postamble = “““\n
\n\n\n“““
def colorxhtml(img drawable filename raw_filename
source_type characters size separate):
width = drawable.width
height = drawable.height
bpp = drawable.bpp
if not drawable.is_rgb or drawable.has_alpha:
return
gimp.tile_cache_ntiles(width / gimp.tile_width() + 1)
html = file(filename ‘w‘)
if separate:
dirname cssfile = os.path.split(filename)
cssfile = os.path.splitext(cssfile)[0] + ‘.css‘
cssname = os.path.join(dirname cssfile)
css = file(cssname ‘w‘)
if source_type == CHARS_SOURCE:
chars = file(inspect.getsourcefile(colorxhtml)).read()
elif source_type == CHARS_FILE:
chars = file(characters).read()
elif source_type == CHARS_PARAMETER:
chars = characters
allchars = string.maketrans(‘‘ ‘‘)
goodchars = string.digits + string.ascii_letters + string.punctuation
badchars = ‘‘.join([c for c in allchars if c not in goodchars])
chars = chars.translate(allchars badchars)
data = []
for c in chars:
data.append(escape_table.get(c c))
if data:
data.reverse()
else:
data = list(‘X‘ * 80)
pr = drawable.get_pixel_rgn(0 0 width height False False)
gimp.progress_init(_(“Saving as colored XHTML“))
style = style_def % size
i
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
I.A.... 959 2010-07-05 02:25 GIMP2\etc\fonts\conf.d\README
I.A.... 6694 2010-02-17 17:12 GIMP2\Python\Lib\lib2to3\Grammar.txt
I.A.... 821 2008-04-02 11:56 GIMP2\Python\Lib\lib2to3\PatternGrammar.txt
I.A.... 121 2005-10-28 19:07 GIMP2\Python\Lib\site-packages\README.txt
I.A.... 1122 2006-04-18 09:57 GIMP2\Python\Lib\test\leakers\README.txt
I.A.... 31278 2009-10-01 08:10 GIMP2\share\gimp\2.0\help\zh_CN\become-a-gimp-wizard.html
I.A.... 45756 2009-10-01 08:11 GIMP2\share\gimp\2.0\help\zh_CN\bibliography.html
I.A.... 3400 2009-10-01 08:10 GIMP2\share\gimp\2.0\help\zh_CN\common-sc
I.A.... 4622 2009-10-01 08:10 GIMP2\share\gimp\2.0\help\zh_CN\customize-splashscreen.html
I.A.... 9377 2009-10-01 08:10 GIMP2\share\gimp\2.0\help\zh_CN\dialogs.html
I.A.... 4823 2009-10-01 08:10 GIMP2\share\gimp\2.0\help\zh_CN\file-print-gtk.html
I.A.... 7511 2009-10-01 08:11 GIMP2\share\gimp\2.0\help\zh_CN\filters-alpha-to-logo.html
I.A.... 7655 2009-10-01 08:11 GIMP2\share\gimp\2.0\help\zh_CN\filters-animation.html
I.A.... 3493 2009-10-01 08:11 GIMP2\share\gimp\2.0\help\zh_CN\filters-artistic.html
I.A.... 10002 2009-10-01 08:11 GIMP2\share\gimp\2.0\help\zh_CN\filters-blur.html
I.A.... 3479 2009-10-01 08:11 GIMP2\share\gimp\2.0\help\zh_CN\filters-combine.html
I.A.... 3635 2009-10-01 08:11 GIMP2\share\gimp\2.0\help\zh_CN\filters-decor.html
I.A.... 3817 2009-10-01 08:11 GIMP2\share\gimp\2.0\help\zh_CN\filters-distort.html
I.A.... 4871 2009-10-01 08:11 GIMP2\share\gimp\2.0\help\zh_CN\filters-edge.html
I.A.... 3615 2009-10-01 08:11 GIMP2\share\gimp\2.0\help\zh_CN\filters-enhance.html
I.A.... 4111 2009-10-01 08:11 GIMP2\share\gimp\2.0\help\zh_CN\filters-generic.html
I.A.... 4708 2009-10-01 08:11 GIMP2\share\gimp\2.0\help\zh_CN\filters-light-and-shadow.html
I.A.... 3860 2009-10-01 08:11 GIMP2\share\gimp\2.0\help\zh_CN\filters-map.html
I.A.... 3802 2009-10-01 08:11 GIMP2\share\gimp\2.0\help\zh_CN\filters-noise.html
I.A.... 3901 2009-10-01 08:11 GIMP2\share\gimp\2.0\help\zh_CN\filters-render.html
I.A.... 4007 2009-10-01 08:11 GIMP2\share\gimp\2.0\help\zh_CN\filters-web.html
I.A.... 37174 2009-10-01 08:11 GIMP2\share\gimp\2.0\help\zh_CN\filters.html
I.A.... 5079 2009-10-01 08:10 GIMP2\share\gimp\2.0\help\zh_CN\font-problems.html
I.A.... 11397 2009-10-01 08:10 GIMP2\share\gimp\2.0\help\zh_CN\getting-started.html
I.A.... 9212 2009-10-01 08:11 GIMP2\share\gimp\2.0\help\zh_CN\gfdl-1.html
............此处省略5811个文件信息
相关资源
- linux内核源码剖析-TCPIP实现上下册合集
- 数字图像处理 -完整高清
- 数字图像处理(第六版) 抖动算法
- 数字图像处理第四版英文版
- 对摄像头采集到的图像进行缩放、切
- 图像处理与计算机视觉算法及应用-第
- 基于opencv的图像处理
- 数字图像处理第三版中文+课件
- ENVI遥感图像处理方法 第2版带pdf目录
- DXperienceXaf-9.2.6
- 数字图像处理 原书第四版 pdf完整版
- 上海交通大学 医学图像处理技术 全
- 图像局部不变形特征与描述 王永明
- 数字图像处理_第三版_冈萨雷斯_书+课
- dubbo-admin-2.6.0 war包
- 数字图像处理 冈萨雷斯 第三版英文
- 《VTK图形图像开发进阶》随书代码
- 山东大学数字图像处理实验1-4
- 数字图像处理疑难解析(英)Petrou机
- 数字图像处理 原书第3版(W.K.Pratt)
- 数字图像处理m文件,代码及图片素材
- 数字图像处理学 阮秋琦 pdf
- 图像处理标准图集合 lena peppers woman
- gsl-2.6.7z
- 学习OpenCV3中文版实力源码
- STM32 OV2640 机器视觉 图像处理 滚球系
- Digital image processing 数字图像处理第三
- 图像处理经典测试图片
- imaris_中文教程.pdf
- 海康威视图像处理Demo
评论
共有 条评论