public static void main(String[] args)
    {
        int i;

        TestEncoder te = new TestEncoder("Test PNG Alpha/Filter Encoder");
        i = 0;
        te.encodeAlpha = false;
        te.filter = 0;
        te.pixelDepth = 24;
        te.compressionLevel = 1;
        while (i < args.length)
        {
            if (args[i].equals("-alpha"))
            {
                te.encodeAlpha = true;
                i++;
            }
            else if (args[i].equals("-filter"))
            {
                if (i != args.length-1)
                {
                    try
                    {
                        te.filter = Integer.parseInt(args[i+1]);
                    }
                    catch (Exception e)
                    {
                        usage();
                        break;
                    }
                }
                i += 2;
            }
            else if (args[i].equals("-compress"))
            {
                if (i != args.length-1)
                {
                    try
                    {
                        te.compressionLevel = Integer.parseInt(args[i+1]);
                    }
                    catch (Exception e)
                    {
                        usage();
                        break;
                    }
                }
                i += 2;
            }
            else
            {
                usage();
                break;
            }
        }
        if (te.pixelDepth == 8)
        {
            te.encodeAlpha = false;
        }
        te.doYourThing();
    }