[brailleblaster] Re: Basic Graphic Manipulation

  • From: Chris von See <chris@xxxxxxxxxxxxx>
  • To: brailleblaster@xxxxxxxxxxxxx
  • Date: Sun, 14 Nov 2010 10:38:10 -0800

I *think* that AWT means "abstract windowing toolkit", but I'm not sure. AWT was the first Java GUI controls package, prior to Swing - it's been in place since Java 1.0, I think.


I'm not saying that PNG is a bad choice - just that JPEGs are smaller and - I think - are more widely used than PNGs, especially where image fidelity is not a huge issue...

Chris

On Nov 14, 2010, at 10:17 AM, John J. Boyer wrote:

Thanks, as usual. PNG was chosen because it seemed more suitable for
representing tactile graphics. Incidentally, what does awt mean? We'll
have no lack of graphics packages anyway.

John

On Sun, Nov 14, 2010 at 10:00:31AM -0800, Chris von See wrote:
Java has built-in classes for reading and manipulating graphics - take
a look at the "java.awt", "java.awt.image" and "javax.imageio"
packages in the JDK.  You may need to use a bit of matrix math to do
the transformations needed for rotation and scaling, but most image
operations are not particularly difficult once you get the hang of
using the classes.  If you'd prefer, you can also call a utility such
as ImageMagick to perform many operations; ImageMagick has Java
bindings that are part of the JMagick project at Sourceforge
(http://sourceforge.net/projects/jmagick/ ), or you can just spin off a separate process using standard Java facilities (java.lang.ProcessBuilder
or java.lang.Runtime, plus  java.lang.Process).

A quick search also turned up the Apache Commons Sanselan project and
the "java-image-scaling" project on Google Code.   I've not used
either of these tools personally.

You may want to consider using JPEG instead of PNG for your image
format.  Because of its built-in compression a JPEG is considerably
smaller than an equivalent PNG, and unless you're doing very fine-
resolution work where you'd be concerned about even the slightest
potential loss of data the JPEGs are more than equal to the task.
NIMAS and DAISY support both JPEG and PNG, as well as SVG; if you want
to handle SVGs you should look at the Apache Batik project, the
Inkscape tool or perhaps the Uniconverter project on Sourceforge,
since the Java ImageIO classes won't handle vector graphics at all.


Cheers
Chris

On Nov 14, 2010, at 7:37 AM, John J. Boyer wrote:

Just as we will be using itex2MML so a user can enter math in TeX, we
will probably need some basic graphic manipulation ability, such as
resizing, changing resulution, rotating, etc. We will probably be
using
PNG (Portable Network Graphics). Can such basic manipulation be
handled
with the SWT widgets? If not, what Java library might do them and also
use SWT?

Thanks,
John

--
John J. Boyer; President, Chief Software Developer
Abilitiessoft, Inc.
http://www.abilitiessoft.com
Madison, Wisconsin USA
Developing software for people with disabilities




--
John J. Boyer; President, Chief Software Developer
Abilitiessoft, Inc.
http://www.abilitiessoft.com
Madison, Wisconsin USA
Developing software for people with disabilities




Other related posts: