Check out Janggi (Korean Chess), our featured variant for December, 2024.


[ Help | Earliest Comments | Latest Comments ]
[ List All Subjects of Discussion | Create New Subject of Discussion ]
[ List Earliest Comments Only For Pages | Games | Rated Pages | Rated Games | Subjects of Discussion ]

Comments/Ratings for a Single Item

EarliestEarlier Reverse Order LaterLatest
Diagram Designer. Lets you display diagrams without uploading any graphics.[All Comments] [Add Comment or Rating]
Greg Strong wrote on Fri, Sep 18, 2020 08:31 PM UTC:

Oh, ok. I guess that makes sense. Unfortunately, that means the diagram designer can't show uncheckered boards, but that's not critical.


Greg Strong wrote on Sat, Sep 19, 2020 06:23 PM UTC:

With some extensive testing I've been able to figure out the issue, although I don't understand it. The piece sets that don't work with diagram designer all have an extra carriage return at the end. Remove it, and they work fine. Take a file that works, put an extra blank line after the ?> line, and it breaks. Very odd for whitespace to break code...


🕸💡📝Fergus Duniho wrote on Sat, Sep 19, 2020 09:21 PM UTC in reply to Greg Strong from 06:23 PM:

The piece sets that don't work with diagram designer all have an extra carriage return at the end.

That makes perfect sense. While the Game Courier scripts create an HTML page, the drawdiagram.php script used by the Diagram Designer produces an image file. If that image file contains any text, even a white space, it is corrupted.


Greg Strong wrote on Sat, Sep 19, 2020 09:46 PM UTC:

I am referring to a space in the php file that defines the piece set, not the image file created by the script. The diagram designer executes php code to dynamically create and return a binary image, right? Why would whitespace in the php source code of a program affect its output?

Update: Ok, maybe I see. Since the space is outside the ?> it gets incorporated into the output stream?


🕸💡📝Fergus Duniho wrote on Sun, Sep 20, 2020 12:45 AM UTC in reply to Greg Strong from Sat Sep 19 09:46 PM:

Ok, maybe I see. Since the space is outside the ?> it gets incorporated into the output stream?

Yes. Unlike Game Courier, which saves an image file to the server, drawdiagram.php simply becomes the image file. So, it's output has to be a pure image file. Since the set file gets included in it, that set file must be free of any text output.


Greg Strong wrote on Sun, Sep 20, 2020 06:46 PM UTC in reply to Fergus Duniho from 12:45 AM:

Ok, I have removed extra whitespace from all piece sets and verified that they all now work in diagram designer.


Vibra_nium wrote on Fri, Apr 23, 2021 10:57 PM UTC:

I cant even use it. HELP!!!


Greg Strong wrote on Sat, Apr 24, 2021 01:06 AM UTC in reply to Vibra_nium from Fri Apr 23 10:57 PM:

I cant even use it. HELP!!!

When you do not even say what you do not understand, or what you have done, or what problem you are having, it is not possible for anyone to help you.

You must invest time yourself if you seriously expect anyone else to invest time to help you.


Jörg Knappen wrote on Fri, May 7, 2021 05:08 PM UTC:
Got a problem with this move diagram: The central piece is not shown on my screen:

Greg Strong wrote on Fri, May 7, 2021 05:36 PM UTC in reply to Jörg Knappen from 05:08 PM:

The central piece is not shown on my screen

Hmmm... This does not make sense to me.  The snake image is just a PNG.  What browser are you using?


Jörg Knappen wrote on Fri, May 7, 2021 05:45 PM UTC in reply to Greg Strong from 05:36 PM:

Greg, you can see it?

I'm using Firefox 88.0 on Ubuntu. I saw the snake in the process of creating the diagram, it was still there with the first two dots in the same rank, bit it disappeared mysteriously with the completion of the diagram.


Jörg Knappen wrote on Fri, May 7, 2021 05:48 PM UTC in reply to Jörg Knappen from 05:45 PM:

Trying konqueror as an alternative browser, it shows the snake. Strange ...


Greg Strong wrote on Fri, May 7, 2021 06:30 PM UTC in reply to Jörg Knappen from 05:45 PM:

Yes, I can see it. To confirm, I just checked with Firefox 88.0.1 on Linux Mint and it shows fine there too...


🕸💡📝Fergus Duniho wrote on Fri, May 7, 2021 06:48 PM UTC:

Since the diagram designer is a server-side script that generates and outputs an image file, the browser used should not make any difference.


H. G. Muller wrote on Fri, May 7, 2021 08:10 PM UTC in reply to Greg Strong from 06:30 PM:

I can confirm that originally the Snake was not displayed in the diagram that Jörg posted. I looked at the page source, and the diagram was a direct link to the diagram generator, which did contain the S in the intended square in the CGI parameter. But no show... But now it magically appeared, with the same browser (FireFox). There must have been something temporarily wrong on the server, such that the server-side script could not find the Snake image file to compose the entire image.


🕸💡📝Fergus Duniho wrote on Fri, May 7, 2021 09:08 PM UTC in reply to H. G. Muller from 08:10 PM:

There must have been something temporarily wrong on the server, such that the server-side script could not find the Snake image file to compose the entire image.

Yes, I made all $dir values relative today, and I had to fix the diagram designer before it would work properly with relative URLs.


🕸💡📝Fergus Duniho wrote on Tue, Nov 15, 2022 08:53 PM UTC:

I have updated the ability to mark moves. The ! symbol now displays a dot in the last color. So, if you want to use a specific color, you can add it to the list of colors.

The braces can now be used to display multiple items on the same space. Symbols between braces should be separated by spaces. They will be drawn in the order that they appear. So, if you want a dot over a piece, put the piece label first, then after a space, put a # or !.


Daniel Zacharias wrote on Fri, Nov 25, 2022 02:31 AM UTC:

For editing diagrams from existing pages, it would be useful to be able to load the diagram designer settings from an existing generated URL


🕸💡📝Fergus Duniho wrote on Fri, Nov 25, 2022 04:21 PM UTC in reply to Daniel Zacharias from 02:31 AM:

You can do that by replacing drawdiagram.php with diagram-designer.php while keeping the rest of the URL the same.


H. G. Muller wrote on Thu, Dec 15, 2022 11:19 AM UTC:

I have a question on using image names in the code argument of the Diagram Designer. The example on the page here only shows an input that uses a single letter per piece, and shows how letters correspond to images on the right. But some piece sets have many more than 26 images. Now I noticed in the URL used for the static image in Central Point Chess that it would also possible to use a piece name in braces instead of a single letter, where the case indicates the color. Like {PAWN} or {king}. But this was for the alfaeriePNG set, which uses all-lowercase names for the images. How would that work for a piece set that uses mixed case, such as Abstract? Would the DD know that it alwasy has to capitalize the first character, and use upper-case W and B prefixes in such a case? And can one mix single-letter encoding with the braces construction?

[Edit] Never mind, I think I figured it out. The use of braces is a general method for allowing multi-character piece names, but the mapping of the names on names of image files is specified by the initialization $pieces array in the sets/*.php scripts. And only in sets/ auto-*.php scripts this mapping is set from all upper- or lower-case full names to the white and black image-file names.

These scripts differ only in the setting of the $dir variable. So I can easily clone those, to make auto scripts for AlfaeriePNG, AlfaeriePNG35, XBoard, XBoard33, Abstract, Motif, MagneticPNG, Utrecht and Utrecht (Small), in which besides using the full names you can also use single-letter IDs for the orthodox pieces (and perhaps some common fairies?) in the code parameter.

Below an example of a diagram using the AlfaeriePNG set:


🕸💡📝Fergus Duniho wrote on Thu, Dec 15, 2022 04:43 PM UTC in reply to H. G. Muller from 11:19 AM:

Yes, it sounds like you figured it out.


🕸💡📝Fergus Duniho wrote on Sat, Dec 24, 2022 03:41 PM UTC:

Now that I have a better handle on how Alpha values work, I have gotten the Diagram Designer to use and pass them along to the PNG file. I have added a new parameter to drawdiagram.php called bgcolor, which is for the background color used when shrinking an SVG image to a particular size. Its default is FFFFFF00, which is a fully transparent white. When the Alpha value is given in bgcolor, it will just use the generated Alpha values for each pixel. When the Alpha value is not given, it will just color the outer area with a transparent color. The left image uses FFFFFF00 for the background color, and the second uses 666666 for the background color.


🕸💡📝Fergus Duniho wrote on Sat, Dec 24, 2022 05:36 PM UTC in reply to Fergus Duniho from 03:41 PM:

There is no difference between using a background color of FFFFFF00 and 00000000. They produce identical results. So, when the background color is fully transparent, its RGB values will not affect the results of the anti-aliasing.


🕸💡📝Fergus Duniho wrote on Sat, Dec 24, 2022 06:01 PM UTC in reply to Fergus Duniho from 05:36 PM:

When the Alpha value is above zero and so not fully transparent, the RGB colors do matter. Here is FFFFFF44 on the left and 00000044 on the right. The latter has more solid borders than FFFFFF00, and it has smoother borders than 666666.

Contrary to what I wrote below, GD will now makes the background transparent for any background color that was not fully transparent from the beginning. This keeps it from recoloring the whole space when using an Alpha value above zero.


H. G. Muller wrote on Sun, Dec 25, 2022 11:20 AM UTC:

And if you make all board squares black, you would have the ultimate solid borders, which extend all the way to the square edge.

But if you want more solid outlines than a piece was designed to have, it would be better to make the stroke width an adjustable parameter of the Diagram Designer, just like the fill color. This is trivial to do, by doing a text replacement while the image is still SVG, before rendering it.


25 comments displayed

EarliestEarlier Reverse Order LaterLatest

Permalink to the exact comments currently displayed.