/[projet1]/public/pc/tools/osdk/main/Osdk/_final_/documentation/doc_pictconv.htm
Defence Force logotype

Annotation of /public/pc/tools/osdk/main/Osdk/_final_/documentation/doc_pictconv.htm

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1118 - (hide annotations)
Mon Feb 24 19:28:30 2014 UTC (5 years, 7 months ago) by dbug
File MIME type: text/html
File size: 13589 byte(s)
Osdk 1.1 
- Updated Oricutron to version 1.1
1 dbug 70 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN">
2    
3     <HTML lang=fr dir=ltr>
4     <HEAD>
5     <meta name="robots" content="noindex">
6     <meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
7     <title>OSDK - PictConv</title>
8     <link href="documentation.css" rel="stylesheet" type="text/css">
9     </HEAD>
10    
11     <BODY>
12    
13     <hr>
14     <A href="documentation.htm"><img src="arrow_back.gif"></A>
15     <img src="pics/osdk_logo_small.png">
16     <hr>
17    
18     <h1>PictConv</h1>
19    
20     <p id=chapter>Description</p>
21    
22     <p>PictConv is a tool that can be used to convert pictures created with a standard
23     PC paint program (PaintShopPro, PhotoShop, ...), in a format displayable on the Oric.
24     </p>
25    
26    
27     <p id=chapter>Utilisation</p>
28    
29     <p>To convert a picture:
30     </p>
31     <pre>
32     %OSDK%\bin\PictConv [switches] source_picture destination_file
33     </pre>
34 dbug 208 <p>Supported formats for the source picture is everything that FreeImage supports (BMP, PCX, PNG, TGA and TIFF among other).
35 dbug 70 </p>
36    
37    
38     <p id=chapter>Switches</p>
39 dbug 208 <ul>
40 dbug 70
41 dbug 208 <li>The -m switch is used to define what the target machine is:
42 dbug 70 <p>
43     <pre>
44 dbug 208 -m0 => Oric [Default]
45     -m1 => Atari ST
46 dbug 70 </pre>
47     </p>
48     </li>
49    
50 dbug 208 <li>The -f switch control the type of picture conversion that will be performed. This is machine dependent:
51 dbug 70 <p>
52     <pre>
53 dbug 208 <b>Oric</b>:
54     -f0 => to hires monochrom format [default]
55     -f0z => to hires monochrom format (do not set bit 6) *** Not working in this version ***
56     -f1 => precolored picture
57     -f2 => RVB conversion
58     -f3 => Twilight masks
59     -f4 => RB conversion
60 dbug 1118 -f5 => CHAR generator (not finished)
61     -f6 => Sam method (Img2Oric)
62 dbug 208 <b>Atari ST</b>:
63     -f0 => Single palette format [default]
64     -f1 => Multi palette format
65 dbug 70 </pre>
66     </p>
67     </li>
68    
69     <li>The -o switch defines the final file format:
70     <p>
71     <pre>
72     -o0 => Tape format, including a BASIC loader
73     -o1 => Tape format, simply the picture
74     -o2 => RAW format. No header.
75     -o3[label name] => C source code
76     -o4[label name] => assembler source code
77     -o5 => Output a PC picture format
78     -o6 => 2 bytes (dx,dy) size followed by RAW picture
79 dbug 208 -o7 => palette followed by picture
80 dbug 70 -o8[line:step] => BASIC source code
81     </pre>
82 dbug 208 For <b>-o3</b> and <b>-o4</b>, if <i>"label name"</i> is not defined, the default <i>"LabelPicture"</i> is used.<br>
83     For <b>-o8</b> you can specify two values that will be taken respectively as the first line number and the step between lines.
84 dbug 70 </p>
85 dbug 208
86     <p>One very useful feature is the <b>-o5</b> mode which instead of saving to the Oric or Atari format, will save the result of the conversion to a pc format.
87     This is very practical when experimenting with multi-palette or dithering options, because you do not have to try on the real machine, you can just check the
88     result directly on your pc.
89     </p>
90    
91     <p>When doing Atari conversion, you typically want to use the <b>-o7</b> mode, which will save the palette (or palettes) followed by the bitmap.
92     You don't really want to try other formats because they will not work well in this version for the atari conversions (they were made for the Oric and I did not update the code yet.</p>
93    
94 dbug 70 </li>
95    
96 dbug 208 <li>The -p switch controls the way palettes are managed:
97     <p>
98 dbug 70 <pre>
99 dbug 208 -p0 => Generate a palette automatically [default]
100     -p1 => Last line of the picture contains the palette
101     -p2 => Last pixels of each line of the picture contains the palette
102 dbug 70 </pre>
103 dbug 208 </p>
104    
105     <p>When using <b>-p0</b>, PictConv will automatically perform the palette generation, using the STe enhanced palettes, eventually reducing the color depth if more than 16 colors are used.
106     If the color conversion is done with the <b>-f0</b> format, one single palette will be generated in the final picture. If the <b>-f1</b> format is used, then one palette will be generated for each scanline.
107     </p>
108     <p>If you want to use <b>-p1</b> or <b>-p2</b>, you need to modify your input picture to include palette data. An important point to miss, is that you can use <b>-p1</b> with <b>-f1</b>.
109     At first glance it would look like you would use the same single palette repeated for every scanline, which seems to be of dubious interest, but it makes sense when you will learn that the
110     palettes you specify do not have to be complete. Only the color indexes defined in the palette will be used in the conversion process, the free indexes will be used by the color reduction routine.</p>
111    
112     <p>When using <b>-p1</b>, you need to add two scanlines at the bottom of your picture. So if your picture is 320x200, you will have to make it 320x202, the two last lines will be used by PictConv to figure out which colors to use.
113     (Of course the exported picture will be 320x200). The way it works, is that these two additional lines will contains colors that will be interpreted as either "not set" colors, or "fixed colors".
114     The first pixel of the first additional line will be used as "not set" color, the 16 first pixels of the second additional line will be the palette itself.
115     Each of these 16 pixels that are of the same color as the "not set" color will be ignored. Others will be interpreted as colors that have to be kept at this particular position in the palette.
116     That's particularly useful to make sure that your background color is at index 0, and that this particular sprite is using the color 8 of the palette.
117     </p>
118     <p>Some examples will make it easier to understand:
119     <br>
120     <img SRC="pics/osdk_rasters.png" WIDTH=159 HEIGHT=53 alt="Original logo, 1632 colors">
121     =>
122     <img SRC="pics/osdk_atari_f0.png" WIDTH=159 HEIGHT=53 alt="Converted with -m1 -f0">
123     =>
124     <img SRC="pics/osdk_atari_p0.png" WIDTH=159 HEIGHT=53 alt="Converted with -m1 -f1 -p0">
125     <br>
126     <img SRC="pics/osdk_rasters_p1.png" WIDTH=159 HEIGHT=53 alt="Original logo, 1632 colors, with palette at the bottom">
127     =>
128     <img SRC="pics/osdk_atari_p1_multipalette.png" WIDTH=159 HEIGHT=53 alt="Converted with -m1 -f1 -p1">
129     <br>
130     <img SRC="pics/osdk_rasters_p2.png" WIDTH=159 HEIGHT=53 alt="Original logo, 1632 colors, with palettes at the right">
131     =>
132     <img SRC="pics/osdk_atari_p2_multipalette.png" WIDTH=159 HEIGHT=53 alt="Converted with -m1 -f1 -p2">
133     </p>
134 dbug 70 </li>
135    
136 dbug 208 <li>The -d switch controls the dithering operation:
137     <p>
138 dbug 70 <pre>
139 dbug 208 -d0 => No dithering (0/1)
140     -d1 => Alternate dithering (0/0.5/1)
141     -d2 => Ordered dithering (4x4 matrix, 8 levels)
142     -d3 => Riemersma dithering (based on hilbert curves)
143 dbug 70 </pre>
144 dbug 208 </p>
145 dbug 70 </li>
146    
147 dbug 208 <li>The -t switch enable the testing mode:
148     <pre>
149     -t0 => Testing disabled
150     -t1 => Testing enabled
151     </pre>
152     </li>
153    
154 dbug 70 <li>The -n switch defines the number of entries per line when generating text format:
155     <pre>
156     -n16 => Output 16 values each line
157     -n40 => Output 40 values each line
158     </pre>
159     </li>
160     </ul>
161    
162     <p id=chapter>Some picture samples</p>
163    
164     <p>
165     Here are some conversion samples, with the parameters used.
166     </p>
167    
168    
169     <center>
170    
171     <br>
172     Buffy
173     <br>
174     <img SRC="pics/buffy.jpg" WIDTH=240 HEIGHT=200>
175     <br>
176     <table cellspacing="5">
177     <tr>
178     <th></th>
179     <th>-f0</th>
180     <th>-f2</th>
181     </tr>
182     <tr>
183     <th>-d0</th>
184     <td><img SRC="pics/buffy_0_0.gif" WIDTH=240 HEIGHT=200></td>
185     <td><img SRC="pics/buffy_2_0.gif" WIDTH=240 HEIGHT=200></td>
186     </tr>
187     <tr>
188     <th>-d1</th>
189     <td><img SRC="pics/buffy_0_1.gif" WIDTH=240 HEIGHT=200></td>
190     <td><img SRC="pics/buffy_2_1.gif" WIDTH=240 HEIGHT=200></td>
191     </tr>
192     <tr>
193     <th>-d2</th>
194     <td><img SRC="pics/buffy_0_2.gif" WIDTH=240 HEIGHT=200></td>
195     <td><img SRC="pics/buffy_2_2.gif" WIDTH=240 HEIGHT=200></td>
196     </tr>
197     <tr>
198     <th>-d3</th>
199     <td><img SRC="pics/buffy_0_3.gif" WIDTH=240 HEIGHT=200></td>
200     <td><img SRC="pics/buffy_2_3.gif" WIDTH=240 HEIGHT=200></td>
201     </tr>
202     </table>
203     <br>
204    
205    
206     <br>
207     Mire
208     <br>
209     <img SRC="pics/mire2.gif" WIDTH=240 HEIGHT=200>
210     <br>
211     <table cellspacing="5">
212     <tr>
213     <th></th>
214     <th>-f0</th>
215     <th>-f2</th>
216     </tr>
217     <tr>
218     <th>-d0</th>
219     <td><img SRC="pics/mire2_0_0.gif" WIDTH=240 HEIGHT=200></td>
220     <td><img SRC="pics/mire2_2_0.gif" WIDTH=240 HEIGHT=200></td>
221     </tr>
222     <tr>
223     <th>-d1</th>
224     <td><img SRC="pics/mire2_0_1.gif" WIDTH=240 HEIGHT=200></td>
225     <td><img SRC="pics/mire2_2_1.gif" WIDTH=240 HEIGHT=200></td>
226     </tr>
227     <tr>
228     <th>-d2</th>
229     <td><img SRC="pics/mire2_0_2.gif" WIDTH=240 HEIGHT=200></td>
230     <td><img SRC="pics/mire2_2_2.gif" WIDTH=240 HEIGHT=200></td>
231     </tr>
232     <tr>
233     <th>-d3</th>
234     <td><img SRC="pics/mire2_0_3.gif" WIDTH=240 HEIGHT=200></td>
235     <td><img SRC="pics/mire2_2_3.gif" WIDTH=240 HEIGHT=200></td>
236     </tr>
237     </table>
238     <br>
239    
240    
241     <br>
242     Moxica
243     <br>
244     <img SRC="pics/moxica1.jpg" WIDTH=240 HEIGHT=200>
245     <br>
246     <table cellspacing="5">
247     <tr>
248     <th></th>
249     <th>-f0</th>
250     <th>-f2</th>
251     </tr>
252     <tr>
253     <th>-d0</th>
254     <td><img SRC="pics/moxica1_0_0.gif" WIDTH=240 HEIGHT=200></td>
255     <td><img SRC="pics/moxica1_2_0.gif" WIDTH=240 HEIGHT=200></td>
256     </tr>
257     <tr>
258     <th>-d1</th>
259     <td><img SRC="pics/moxica1_0_1.gif" WIDTH=240 HEIGHT=200></td>
260     <td><img SRC="pics/moxica1_2_1.gif" WIDTH=240 HEIGHT=200></td>
261     </tr>
262     <tr>
263     <th>-d2</th>
264     <td><img SRC="pics/moxica1_0_2.gif" WIDTH=240 HEIGHT=200></td>
265     <td><img SRC="pics/moxica1_2_2.gif" WIDTH=240 HEIGHT=200></td>
266     </tr>
267     <tr>
268     <th>-d3</th>
269     <td><img SRC="pics/moxica1_0_3.gif" WIDTH=240 HEIGHT=200></td>
270     <td><img SRC="pics/moxica1_2_3.gif" WIDTH=240 HEIGHT=200></td>
271     </tr>
272     </table>
273     <br>
274    
275    
276     <br>
277     Lena
278     <br>
279     <img SRC="pics/lena.gif" WIDTH=240 HEIGHT=200>
280     <br>
281     <table cellspacing="5">
282     <tr>
283     <th></th>
284     <th>-f0</th>
285     <th>-f2</th>
286     </tr>
287     <tr>
288     <th>-d0</th>
289     <td><img SRC="pics/lena_0_0.gif" WIDTH=240 HEIGHT=200></td>
290     <td><img SRC="pics/lena_2_0.gif" WIDTH=240 HEIGHT=200></td>
291     </tr>
292     <tr>
293     <th>-d1</th>
294     <td><img SRC="pics/lena_0_1.gif" WIDTH=240 HEIGHT=200></td>
295     <td><img SRC="pics/lena_2_1.gif" WIDTH=240 HEIGHT=200></td>
296     </tr>
297     <tr>
298     <th>-d2</th>
299     <td><img SRC="pics/lena_0_2.gif" WIDTH=240 HEIGHT=200></td>
300     <td><img SRC="pics/lena_2_2.gif" WIDTH=240 HEIGHT=200></td>
301     </tr>
302     <tr>
303     <th>-d3</th>
304     <td><img SRC="pics/lena_0_3.gif" WIDTH=240 HEIGHT=200></td>
305     <td><img SRC="pics/lena_2_3.gif" WIDTH=240 HEIGHT=200></td>
306     </tr>
307     </table>
308     <br>
309    
310    
311     </center>
312    
313    
314    
315    
316    
317     <p id=chapter>Frequently Asked Questions</p>
318    
319     <ul>
320     <li>
321     <p>
322     <b>In colored mode, free size pictures are not accepted. Why ???</b>
323     </p>
324     <p>
325     Try to imagine how you could scroll horizontaly a picture containing
326     attributes changes without having huge color changes. This is not possible.
327     Free vertical size is allowed anyway, but it's buggy right now :))
328     </p>
329     </li>
330    
331    
332     <li>
333     <p>
334     <b>In colored mode, the converted picture contains some lines that are black and white.</b>
335     </p>
336     <p>
337     These scanlines cannot be converted. A colored pictures should use Oric constraints,
338     be in at most 8 colors, no more than 2 colors per 6 pixel bloc, and so on...
339     </p>
340     </li>
341    
342     <li>
343     <p>
344     <b>In colored mode, PictConv decided to use strange paper and ink changes.</b>
345     </p>
346     <p>
347     Actually PictConv simply tries all the possible combinations of paper, ink, video inverse
348     changes that could work to convert the picture. When it find one working combination,
349     it moves to the next scanline.
350     </p>
351     </li>
352     </ul>
353    
354    
355     <p id=chapter>History</p>
356    
357     <p>Here is the list of all releases with a short description of things that changed:
358     </p>
359    
360 dbug 208 <p id=dateentry>Version 0.013</p>
361     - It is now possible to lock some colors index to some particular values.<br>
362    
363     <p id=dateentry>Version 0.012</p>
364     - Lot of modifications in the codebase to handle more cleanly the various types of machines.<br>
365     - The Atari ST now can generate multi-palette pictures.<br>
366     - Color reduction is now done by PictConv, no need to reduce to 16 colors manually.<br>
367    
368 dbug 70 <p id=dateentry>Version 0.011</p>
369     - Added the -o7 format to generate BASIC source codes.<br>
370     - Removed the constraints in the -f1 mode, pictures just need to be multiple of 6 in width, and no more than 240 pixel wide.
371    
372     <p id=dateentry>Version 0.010</p>
373     - If there is something specified after -o3 or -o4 modes, it's used as a label name to use when generating source code data.<br>
374     - If there is a 'z' specified after -f0 mode (monochrome conversion), it means that bit 6 should not be set in converted bytes<br>
375     - Added -n switch to set the number of values per line (stolen from Bin2Txt !)<br>
376    
377     <p id=dateentry>Version 0.009</p>
378     - New option for generating 'masks' in bits 6 and 7 based on what is presents in bits 0/1/2 and 3/4/5.<br>
379     (Twilighte's request for his new games)<br>
380     - Added a way to convert pictures to something that can be used on an Atari ST.<br>
381     (needed that for my entry to the 20 years anniversary Atari ST compo)<br>
382    
383     <p id=dateentry>Version 0.008</p>
384     - Added "test" mode that's usefull to debug a picture in colored mode
385    
386     <p id=dateentry>Version 0.007</p>
387     - Removed the timer check in the colored conversion mode. It was producing bad
388     conversion on slow computers. Anyway, if you are unlucky, a conversion could
389     now take hours to perform if the tool has to perform ALL possible combinations.
390    
391     <p id=dateentry>Version 0.006</p>
392     - A message is given if the picture is not found or invalid.<br>
393     - Colored mode had some bugs: all now corrected ???<br>
394    
395     <p id=dateentry>Version 0.005</p>
396     - Debugged the -o6 format.<br>
397     - Debugged the -f1 mode.<br>
398    
399     <p id=dateentry>Version 0.004</p>
400     - Allow free size pictures (bigger than screen size except for colored mode)<br>
401    
402     <p id=dateentry>Version 0.003</p>
403     - Riemersman dithering implemented <br>
404    
405     <p id=dateentry>Version 0.002</p>
406     - New version with basic dithering<br>
407    
408     <p id=dateentry>Version 0.001</p>
409     - First beta release<br>
410    
411    
412    
413    
414     <hr>
415     <A href="documentation.htm"><img src="arrow_back.gif"></A>
416     <img src="pics/osdk_logo_small.png">
417     <hr>
418    
419     </BODY>
420     </HTML>
421    
422    

  ViewVC Help
Powered by ViewVC 1.1.26