pixel_raster 1.0.0 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd6246ac2fb2fc015e61ec280b5be406f2eade547be1dce4ced45dbd6120a208
4
- data.tar.gz: 5a2adb8d02a378a963b52304556e6d5636625da5fb4599695c6bf7167c06b0d9
3
+ metadata.gz: 50dd69369485bc474f0f6cad44a37cff12f9b84aaa3ddaf705b54b16e33af02d
4
+ data.tar.gz: a650bec739e058ed2830d57f7868c6a75d82a16bb21489171dd7b54d409a3e1d
5
5
  SHA512:
6
- metadata.gz: 9665873f9a4bfa9525f02a17bd0e2a910a07e26304e90d7ff7580be387a871f197ffa553eaecba4021a299c296264100dad4f59d0e9fd399568b700c07b0d6ae
7
- data.tar.gz: c3f8038be85df22b0583f2ee63da7cb7589174ee2ae44506fdbefe47b51c7d76aaf68d5ef3d4e47b60f8803cd9f6a2d519b4452929ec6469aec1bf2b3a623453
6
+ metadata.gz: 2be80f33d0a55b25ea3baf6779ffb6b035e3635232117dc8749903ac7110338ed1f39a34bc6c9cd81a110764e98bd5f8d5bd3f94228f9d927d91254be094793a
7
+ data.tar.gz: 78c3033647eb003475a26d085c6c008e7cf0ce7c8a303bd0530576d502a34096839672839d9afe106c876e9c0322e12f4e21258bd15acf2b6f16b943ef2ddfde
data/README.md CHANGED
@@ -13,14 +13,20 @@ columns and rows of pixels the image consists of as well as the color
13
13
  The most easy case is a black and white image where each pixel is
14
14
  represented by one bit.
15
15
 
16
- ## A paint yourself binary pixel image
16
+ ## A paint yourself pixel image
17
17
 
18
18
  To explain how an image is represented as data it can help to show
19
19
  paint-yourself raster versions (see [images.pdf](images.pdf)).
20
20
 
21
- ## xpm2tikz
21
+ ## img2pixel
22
+
23
+ The script takes images from the command line as input and
24
+ outputs `svg` or [`tikz`](https://ctan.org/pkg/pgf) code to stdout.
22
25
 
23
- The script takes xpm images from the command line as input and
24
- outputs [tikz](https://ctan.org/pkg/pgf) code to stdout.
26
+ See `img2pixel -h`.
27
+
28
+ ## xpm2tikz
25
29
 
26
- See `xpm2tikz -h`.
30
+ If you have problems installing RMagick you may want to use an older
31
+ (crappier) version instead: [`pixel_raster_xpm`](https://github.com/Lapizistik/pixel_raster_xpm).
32
+ It can only take simple xpm images as input and produces tikz.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.0
1
+ 1.0.2
@@ -90,20 +90,26 @@ module PixelRaster
90
90
  outmode = mode
91
91
  end
92
92
 
93
+ p.on('-r', '--resize [SPEC]',
94
+ 'Resize image to given dimensions.',
95
+ 'See ImageMagick resize specification.') do |spec|
96
+ params[:resize] = spec
97
+ end
98
+
93
99
  p.on('-l','--light2dark',
94
- 'color numbering direction.',
95
- 'Default: light2dark (unless 2 color imgs)') do
100
+ 'Color numbering direction.',
101
+ 'Default: dark2light (unless 2 color imgs)') do
96
102
  params[:light2dark] = true
97
103
  end
98
104
 
99
105
  p.on('-L','--dark2light',
100
- 'color numbering direction.',
101
- 'Default: light2dark (unless 2 color imgs)') do
106
+ 'Color numbering direction.',
107
+ 'Default: dark2light, (unless 2 color imgs)') do
102
108
  params[:light2dark] = false
103
109
  end
104
110
 
105
111
  p.on('-d', '--dir DIR',
106
- 'directory for output files.',
112
+ 'Directory for output files.',
107
113
  'Must exist and be writeable.',
108
114
  "Default: same as INFILE") do |dir|
109
115
  outdir = dir
@@ -171,7 +171,7 @@ module PixelRaster
171
171
  # representation of images!
172
172
  # We therefore assume light2dark _unless_ it's a 2-color image
173
173
  # if it is not explicitely set:
174
- light2dark = colors.length != 2 if light2dark.nil?
174
+ light2dark = colors.length == 2 if light2dark.nil?
175
175
  colors.reverse! if light2dark
176
176
  colors.each_with_index do |p,i|
177
177
  colormap[p]=i
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pixel_raster
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Klaus Stein