<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
 <META NAME="GENERATOR" CONTENT="SGML-Tools 1.0.7">
 <TITLE>AfterStep FAQ: Icons, graphics and pixmaps</TITLE>
 <LINK HREF="AfterStep-FAQ-6.html" REL=next>
 <LINK HREF="AfterStep-FAQ-4.html" REL=previous>
 <LINK HREF="AfterStep-FAQ.html#toc5" REL=contents>
</HEAD>
<BODY>
<A HREF="AfterStep-FAQ-6.html"><IMG SRC="next.gif" ALT="Next"></A>
<A HREF="AfterStep-FAQ-4.html"><IMG SRC="prev.gif" ALT="Previous"></A>
<A HREF="AfterStep-FAQ.html#toc5"><IMG SRC="toc.gif" ALT="Contents"></A>
<HR>
<H2><A NAME="s5">5. Icons, graphics and pixmaps</A></H2>

<P>
<H2><A NAME="ss5.1">5.1 Icons staying put</A>
</H2>

<P>In old versions of AfterStep, an icon to be used in Wharf must contain
at least one transparent pixel; otherwise the symptoms you've
mentioned will turn up.  Simply add a transparent pixel and
everything should work flawlessly.
<P>Newer versions of AfterStep fix this problem, allowing you to use icons
without transparent pixels in the Wharf.  You should really upgrade to the
latest version.
<P>
<H2><A NAME="ss5.2">5.2 Colormap issues</A>
</H2>

<P>Yes, I (Andrew) know that "colour" is spelled incorrectly here.  I can't
help it that those who set up X and Linux spell incorrectly.
<P>
<P>
<H3>When I run AfterStep some of the icons on the button bar don't show up. If I load them at the top they show up, but then the other ones don't.  Also, when I use Netscape, the colors get wacky. What's wrong?</H3>

<P> 
Odds are you are using a 256 color (8bit) display.  A quick explanation is that
you can only have 256 colors on the screen at the same time, and the more
colors you use in Wharf (the button bar), the fewer you can use for other
applications and icons.  I would suggest upgrading your video hardware or using
more conservative (less colorful) icons.  For netscape, an option is to run it
with the 'netscape -install' command.  This will ensure that netscape gets a
good deal of the color that it wants.  It will, however, also result in the
colors flashing whenever you move the mouse in or out the Netscape window. You
decide whether you can live with that.
<P>One trick, it seems, is to run AfterStep without a Wharf.  That reduces the
number of colors used at any one time. 
<P>You might want to use low-color icons, as well; you can find a good collection
of low-color icons (all of them together use only 21 colors) at 
<A HREF="http://the-labs.com/AfterStep/">http://the-labs.com/AfterStep/</A>.
<P>If you are using asclock, you can configure it to use fewer colors.  See below.
<P>After version 1.4, AfterStep uses config. files ending with "8bpp" for 8 bit
displays, and low-color icons from icon/8bpp.  You can modify these files to
use fewer colors.
<P>
<H3>I am having trouble under AS while using xscreensaver with its own colormap.</H3>

<P>So far, no solution has surfaced to this problem.  It appears that AfterStep
is not handing over control of the display.  There seem to be other related
problems of this nature, mostly on Suns.  Any additional information would be
appreciated: Gerhard den Hollander (<CODE>gerhard@jason.nl</CODE>) is working on this
problem.
<P>
<H2><A NAME="ss5.3">5.3 Icons disappear from Wharf. What's wrong?</A>
</H2>

<P>You are most likely running out of colors. Either upgrade your hardware, switch
to a higher color depth (i.e. 16 bpp or higher), or use icons that contain
fewer colors.
<P>
<H2><A NAME="ss5.4">5.4 How do I create an icon with a transparent pixel?</A>
</H2>

<P>  You don't really need to do this any more: the preferred method here is
to upgrade your AS version.  Still, if you don't want to download, you can
fix your problem easily.  An xpm is a simple text file. Therefore, the only
image manipulation software you will need is vi (or some other text editor).
If you edit your xpm, you will become aware of its beauty and simplicity. At
the bottom you will notice a character representation of your image. At the
top there is a color listing corresponding to each pixel of the character
representation.
<P>You have two options to create a transparent pixel:
<P>
<OL>
<LI>Change an existing pixel color to transparent:

Simply find the pixel character(s) you wish to become
transparent, then go back up top and find that character in the
listing.  Change the color code (number beginning with a #) to
None.  Save, and you're all tootin'.
</LI>
<LI>Create a new transparent pixel: 

Edit the line near the top corresponding to the
height/width/number of colors/chars per pixel.  Increment the
number of colors (third value) by one.  Then in the list of
pixels and color values add the line:

<BLOCKQUOTE><CODE>
<PRE>
               c None
</PRE>
</CODE></BLOCKQUOTE>


Where `c' should be a character that is not being used by any other
color. From there save and take off.</LI>
</OL>
<P>If you're the slightest bit unsure, take a look at one of the xpm files in the
AfterStep distribution's icons directory.
<P>The `correct' size for a Wharf icon is 48x48 pixels. However, if you use bigger
icons, they will display correctly, up to 64x64, which is the default size for
the Wharf buttons.
<P>
<H2><A NAME="ss5.5">5.5 How do I make my own XPMs?</A>
</H2>

<P>See the previous question.  Or, if you're trying to convert a compressed
file to an xpm, try using an image-manipulation tool like xv or the GIMP.
<P>
<H2><A NAME="ss5.6">5.6 Where can I find some cool pixmaps for the Wharf or desktop?</A>
</H2>

<P>There are dozens of sites scattered around the Internet which will provide
you with useful graphics.  Some good links to start with can be found on the
official AfterStep home page.
<P>
<H2><A NAME="ss5.7">5.7 Why doesn't program `xyz' work in 16bpp?</A>
</H2>

<P>Several 8bpp programs don't work on displays without a PseudoColor
visual available.  Several PC X servers don't support PseudoColor
visuals on displays running in TrueColor mode. You should buy an SGI.
Or run two simultaneous X servers, if you're on Linux.
<P>Note for SGI users willing to play with their bpp :
<P>One has to tweak the arguments to X in /usr/lib/X11/xdm/Xservers.
The following worked for Tim Buller (<CODE>buller@math.ukans.edu</CODE>)
<P>
<BLOCKQUOTE><CODE>
<PRE>
:0 secure /usr/bin/X11/X -bs -c -nobitscale -visid 0x34
</PRE>
</CODE></BLOCKQUOTE>
<P>Where Visual ID 0x34 (reported by xdpyinfo) is:
<P>
<BLOCKQUOTE><CODE>
<PRE>
  visual:    visual id:    0x34
    class:    TrueColor
    depth:    24 planes
    available colormap entries:    256 per subfield
    red, green, blue masks:    0xff, 0xff00, 0xff0000
    significant bits in color specification:    8 bits
</PRE>
</CODE></BLOCKQUOTE>
<P>
<H2><A NAME="ss5.8">5.8 Why doesn't xv do xyz in 16bpp? </A>
</H2>

<P> xv doesn't cope well with 16bpp in three ways. First, it can't grab
pieces of the screen. Second, if you grab pieces of the screen with xwd and
try to display them with xv, it doesn't work well. xwud works. Third, if you
display a 24bpp picture, it doesn't bother to dither it down to 16bpp,
resulting in bad pictures.  You might want to consider using the GIMP, or
xli.
<P>
<H2><A NAME="ss5.9">5.9 Why don't icon names change when the application changes it?</A>
</H2>

<P>Sorry, but icon names change since AfterStep 1.1.  Upgrade.
<P>
<H2><A NAME="ss5.10">5.10 Why does application xyz not have an icon?</A>
</H2>

<P>You need to define an icon for your program in your database file.  It's a
good idea to define a default icon for all "unknown" programs.  In the
latest versions of AfterStep, you do this in the database file:
<P>
<BLOCKQUOTE><CODE>
<PRE>
Style   "*"             Icon Unknown.xpm
</PRE>
</CODE></BLOCKQUOTE>
<P>
<H2><A NAME="ss5.11">5.11 Why do I get bad behaviour with backgrounds?</A>
</H2>

<P>In earlier versions of AfterStep, background loading was handled at start-up
by invoking another program in the .steprc.  While version 1.4 allowed the use of
XPMs only, 1.4.4 restored the ability to load jpegs (or whatever) with
another program.  The catch is that the auxiliary program is defined in
configure.h at compile time.  Edit the configuration to reflect the accurate
path to your favourite image viewing program, and then re-compile AfterStep.
<P>The default program to use is xli.  Many people don't have this on their
system, and prefer to use xv instead.  This choice is still a compile-time
option.  Moreover, the Pager code is broken in some distributions, so that
the jpeg handling doesn't always work.
<P>The loading of backgrounds is handled by the Pager module.  If you're not
using the Pager, then the backgrounds won't get loaded.  In that case, you
can make the call to the background-loading program in your autoexec file.
<P>As of this writing, the Pager module is being re-coded to include (native)
support for background jpegs.  This new pager is included in a patch to
version 1.5 beta 4.  Version 1.5 will include native support for jpegs.
<P>Note that jpegs don't take any less memory while loaded; they only take less
disk space!
<P>
<HR>
<A HREF="AfterStep-FAQ-6.html"><IMG SRC="next.gif" ALT="Next"></A>
<A HREF="AfterStep-FAQ-4.html"><IMG SRC="prev.gif" ALT="Previous"></A>
<A HREF="AfterStep-FAQ.html#toc5"><IMG SRC="toc.gif" ALT="Contents"></A>
</BODY>
</HTML>
