Import images into CavePainting: Difference between revisions

From VrlWiki
Jump to navigation Jump to search
Jadrian Miles (talk | contribs)
No edit summary
No edit summary
 
(46 intermediate revisions by 3 users not shown)
Line 1: Line 1:
To use images in [[CavePainting]], they need to be in a particular size and format, and have a particular sort of name.  Loading them into the program is pretty easy, but the first time you do it you need to perform an extra setup step.
You can add custom color palettes, slides, paint stroke patterns, or paint stroke masks to [[CavePainting]] simply by loading image files into the program.  In order to work, though, they need to be in a particular size and format, and have a particular sort of name.  Loading them into the program is pretty easy, but the first time you do it you need to perform an extra setup step.


== Image Format ==
= Image Format =
All images used in [[CavePainting]] must be JPEGs (extension .jpg).  See [http://www.cs.brown.edu/courses/cs137/assignments/HelpSession1_CaveIntro.html the CavePainting introduction] for information while this document is under construction.
All images used in CavePainting must be JPEGs (extension .jpg) in RGB color mode (not grayscale, etc.).  The mode of an image can be set in the menu item Image>Mode. In the filename patterns described below, an asterisk (<tt>*</tt>) indicates any text you want. The program loads all your images on startup, so if CavePainting fails to start properly, new images that you're loading for the first time may be to blameCheck the [[Troubleshoot CavePainting startup crashes]] HOWTO for instructions on fixing your images.
<!--
=== Slides ===
Slides, also known as "billboards", are flat images that you can place in virtual space like floating pieces of paperThey have both an image and a mask.
-->


== Loading Images ==
== Common Problems ==
To import images into [[CavePainting]], log into any of the black computers in the Cave room. They are named <tt>dev1</tt> through <tt>dev4</tt>.
* Sometimes having spaces in the names of images can cause problems. To avoid this use snake_case or cameCase for your file names.
* When creating an alpha mask make sure that the alpha mask is ''only'' black and white. Some applications like photoshop use antialiasing when you delete a section which uses the entire gray scale.
** This usually manifests as the cave screen going blank when you launch your account, but other accounts booting up just fine.
* Make sure that your image is in RGB, not CYMK or some other format.


=== Setup ===
== Color Palettes ==
You have to do a little bit of setup the first time you import images. After that, you should be able to just follow the steps in the next section.
Custom color palettes must be 512x512 JPEGs with a filename of the form <tt>color-swatch-table*.jpg</tt>.


# Right-click on the desktop and select "Open Terminal".
{| align="center"
# In the window that opens, type <pre>/share/cs137/cs137-init</pre> and hit enter.
|-
# Close the window.
| valign="top" | [[Image:color-swatch-table_example.jpg|none|thumb|256px|<tt>[[:Image:color-swatch-table_example.jpg|color-swatch-table_example.jpg]]</tt> --- one of the default CavePainting color palettes.]]
| valign="top" | [[Image:color-swatch-table_sam-ballardini.jpg|none|thumb|256px|<tt>[[:Image:color-swatch-table_sam-ballardini.jpg|color-swatch-table_sam-ballardini.jpg]]</tt> --- an example pallette created by a [[CS137]] student.]]
|}


This step creates a folder on your desktop called "CavePainting Directory".  This is where all your files goIf you ever don't see this directory, just repeat the steps above.
== Slides ==
Slides, also known as "billboards", are flat images that you can place in virtual space like floating pieces of paperEach slide depends on two files, a picture and a mask, which must be the same size and have matching filename patternsAlso, the slides must be square (equal width and height) and have dimensions that are powers of 2 (64, 128, 256, 512, 1024, 2048, or 4096).


=== Transferring Files ===
{| {{Prettytable}}
You can plug a key drive into the front of the computer or email files to yourselfWhatever you do, download the files to your desktop, and then drag-and-drop them into the folder called "CavePainting Directory" that you see on the desktop.
|-
! {{Hl2}} | File
! {{Hl2}} | Name Pattern
! {{Hl2}} | Size
! {{Hl2}} | Function
|-
| Picture
| <tt>slide*.jpg</tt>
| rowspan=2 | 64x64, 128x128, 256x256, 512x512, 1024x1024, 2048x2048, 4096x4096
| The picture on the slide.
|-
| Mask
| <tt>alphamask*.jpg</tt>
| A black-and-white image matching the pictureThe picture is visible where the mask is white, and it's transparent where the mask is black.  Make sure the color mode is not grayscale.
|}


== Using Images ==
{| align="center"
You can use images as slides or as patterns or masks on a brush stroke. For instructions, see the [[Use Cavepainting]] HOWTO.
|-
| [[Image:slide_example.jpg|thumb|256px|<tt>[[:Image:slide_example.jpg|slide_example.jpg]]</tt>]]
| [[Image:alphamask_example.jpg|thumb|256px|<tt>[[:Image:alphamask_example.jpg|alphamask_example.jpg]]</tt>]]
|}


== Strokes ==
You can customize the appearance of paint strokes in two different ways.  You can put a particular picture, or ''pattern'', on the stroke, or you can make it transparent in a particular shape with a ''mask''.


[[Category:HOWTO]][[Category:CavePainting]]
Palettes of patterns or masks each have 16 entries in them, each of which is a 64x64 image.  In order to tell CavePainting what all 16 images are, you import them all in one file, with the square images concatenated together in a row.  This gives you 16 64x64 squares lined up in a row, resulting in a 1024x64 JPEG file that you import into the program.  See the examples below to get a better idea of what this means.
 
The vertical direction in the pattern or mask image is aligned with the direction of the stroke --- that is, a pattern that looks like horizontal stripes will result in a brush stroke with stripes across it, whereas a pattern of vertical stripes will result in a brush stroke with stripes along its length.
 
=== Stroke Patterns ===
A stroke pattern applies a pattern of color to a brush stroke.  You should make sure that each element of any custom stroke pattern palette that you create has a little bit of visual texture to it, rather than having any large, flat areas of color.  Depth perception of virtual objects in the [[Cave]] requires that your eyes can match up their two views of every object.  If an object has no surface texture, it is much harder to match up than one with a little bit of texture to it.
 
The filename format for stroke pattern palettes is <tt>pattern*.jpg</tt>.
 
[[Image:Patterns_example.jpg|center|thumb|512px|<tt>[[:Image:Patterns_example.jpg|patterns_example.jpg]]</tt> --- the default CavePainting stroke pattern palette.]]
 
=== Stroke Masks ===
A stroke mask applies a pattern of transparency to a brush stroke.  Stroke masks are black-and-white images; where the mask is white, the stroke is visible, and where it is black, the stroke is transparent.  You probably want any custom stroke mask palette that you create to have one all-white 64x64 block in it, so that you always have the option of drawing an entirely solid stroke.
 
The filename format for stroke mask palettes is <tt>brushtips*.jpg</tt>.
 
 
[[Image:brushtips_example.jpg|center|thumb|512px|<tt>[[:Image:brushtips_example.jpg|brushtips_example.jpg]]</tt> --- the default CavePainting stroke mask palette.]]
[[Image:brushtips_dithered.jpg|center|thumb|512px|<tt>[[:Image:brushtips_dithered.jpg|brushtips_dithered.jpg]]</tt> --- a stroke mask palette for dithered translucency.]]
 
= Loading Images =
To import images into [[CavePainting]], follow these steps:
 
* Prepare the slides (and optional masks) in your program of choice
* Rename the files as described above
* Copy the images to a USB flash drive
* Insert the USB flash drive into the Windows machine
* Open the Windows File Browser from the taskbar
* Navigate to your USB flash drive on the left panel of the File Browser
* Copy the image data you wish to transfer
* Open the "CS137 - Student Directories" link on the desktop and navigate to your user directory
* Paste your image files to your user directory
* Eject your USB key
* Start or restart Cavepainting
* Enjoy your data!
 
= Using Images =
For instructions on how to use slides, stroke patterns, or stroke masks, see the [[Use Cavepainting]] HOWTO.
 
 
[[Category:CavePainting HOWTO]]

Latest revision as of 15:47, 12 September 2017

You can add custom color palettes, slides, paint stroke patterns, or paint stroke masks to CavePainting simply by loading image files into the program. In order to work, though, they need to be in a particular size and format, and have a particular sort of name. Loading them into the program is pretty easy, but the first time you do it you need to perform an extra setup step.

Image Format

All images used in CavePainting must be JPEGs (extension .jpg) in RGB color mode (not grayscale, etc.). The mode of an image can be set in the menu item Image>Mode. In the filename patterns described below, an asterisk (*) indicates any text you want. The program loads all your images on startup, so if CavePainting fails to start properly, new images that you're loading for the first time may be to blame. Check the Troubleshoot CavePainting startup crashes HOWTO for instructions on fixing your images.

Common Problems

  • Sometimes having spaces in the names of images can cause problems. To avoid this use snake_case or cameCase for your file names.
  • When creating an alpha mask make sure that the alpha mask is only black and white. Some applications like photoshop use antialiasing when you delete a section which uses the entire gray scale.
    • This usually manifests as the cave screen going blank when you launch your account, but other accounts booting up just fine.
  • Make sure that your image is in RGB, not CYMK or some other format.

Color Palettes

Custom color palettes must be 512x512 JPEGs with a filename of the form color-swatch-table*.jpg.

color-swatch-table_example.jpg --- one of the default CavePainting color palettes.
color-swatch-table_sam-ballardini.jpg --- an example pallette created by a CS137 student.

Slides

Slides, also known as "billboards", are flat images that you can place in virtual space like floating pieces of paper. Each slide depends on two files, a picture and a mask, which must be the same size and have matching filename patterns. Also, the slides must be square (equal width and height) and have dimensions that are powers of 2 (64, 128, 256, 512, 1024, 2048, or 4096).

File Name Pattern Size Function
Picture slide*.jpg 64x64, 128x128, 256x256, 512x512, 1024x1024, 2048x2048, 4096x4096 The picture on the slide.
Mask alphamask*.jpg A black-and-white image matching the picture. The picture is visible where the mask is white, and it's transparent where the mask is black. Make sure the color mode is not grayscale.
slide_example.jpg
alphamask_example.jpg

Strokes

You can customize the appearance of paint strokes in two different ways. You can put a particular picture, or pattern, on the stroke, or you can make it transparent in a particular shape with a mask.

Palettes of patterns or masks each have 16 entries in them, each of which is a 64x64 image. In order to tell CavePainting what all 16 images are, you import them all in one file, with the square images concatenated together in a row. This gives you 16 64x64 squares lined up in a row, resulting in a 1024x64 JPEG file that you import into the program. See the examples below to get a better idea of what this means.

The vertical direction in the pattern or mask image is aligned with the direction of the stroke --- that is, a pattern that looks like horizontal stripes will result in a brush stroke with stripes across it, whereas a pattern of vertical stripes will result in a brush stroke with stripes along its length.

Stroke Patterns

A stroke pattern applies a pattern of color to a brush stroke. You should make sure that each element of any custom stroke pattern palette that you create has a little bit of visual texture to it, rather than having any large, flat areas of color. Depth perception of virtual objects in the Cave requires that your eyes can match up their two views of every object. If an object has no surface texture, it is much harder to match up than one with a little bit of texture to it.

The filename format for stroke pattern palettes is pattern*.jpg.

patterns_example.jpg --- the default CavePainting stroke pattern palette.

Stroke Masks

A stroke mask applies a pattern of transparency to a brush stroke. Stroke masks are black-and-white images; where the mask is white, the stroke is visible, and where it is black, the stroke is transparent. You probably want any custom stroke mask palette that you create to have one all-white 64x64 block in it, so that you always have the option of drawing an entirely solid stroke.

The filename format for stroke mask palettes is brushtips*.jpg.


brushtips_example.jpg --- the default CavePainting stroke mask palette.
brushtips_dithered.jpg --- a stroke mask palette for dithered translucency.

Loading Images

To import images into CavePainting, follow these steps:

  • Prepare the slides (and optional masks) in your program of choice
  • Rename the files as described above
  • Copy the images to a USB flash drive
  • Insert the USB flash drive into the Windows machine
  • Open the Windows File Browser from the taskbar
  • Navigate to your USB flash drive on the left panel of the File Browser
  • Copy the image data you wish to transfer
  • Open the "CS137 - Student Directories" link on the desktop and navigate to your user directory
  • Paste your image files to your user directory
  • Eject your USB key
  • Start or restart Cavepainting
  • Enjoy your data!

Using Images

For instructions on how to use slides, stroke patterns, or stroke masks, see the Use Cavepainting HOWTO.