https://github.com/jgneff/tofximage
AWT to JavaFX Image Conversion Benchmarks
https://github.com/jgneff/tofximage
awt image javafx swing
Last synced: about 2 months ago
JSON representation
AWT to JavaFX Image Conversion Benchmarks
- Host: GitHub
- URL: https://github.com/jgneff/tofximage
- Owner: jgneff
- License: gpl-3.0
- Created: 2019-06-25T18:20:16.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2020-10-22T18:27:52.000Z (over 5 years ago)
- Last Synced: 2025-04-13T22:59:22.720Z (about 1 year ago)
- Topics: awt, image, javafx, swing
- Language: Java
- Homepage: https://jgneff.github.io/tofximage/
- Size: 3.39 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
This project compares the performance of various methods for converting an AWT image to a JavaFX image, including the public utility method [`SwingFXUtils.toFXImage`](src/main/java/javafx/embed/swing/SwingFXUtils.java).
Although some of the methods convert the alpha values incorrectly, they are included in the tests because their conversion is correct when the source AWT image contains no transparent pixels.
## Results
The results of running the benchmarks on my systems are published on the [website associated with this repository](https://jgneff.github.io/tofximage/).
## Licenses
This project is licensed under the [GNU General Public License v3.0](LICENSE) except for the following file, which is licensed by Oracle under the [GNU General Public License v2.0](src/main/java/javafx/embed/swing/LICENSE) with the [Classpath Exception](src/main/java/javafx/embed/swing/ADDITIONAL_LICENSE_INFO):
* [SwingFXUtils.java](src/main/java/javafx/embed/swing/SwingFXUtils.java)
The contents of the [website](https://jgneff.github.io/tofximage/) and the file [doll-dancing.gif](src/main/resources/doll-dancing.gif) are licensed under the [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/).
The website style is based on [Water.css](https://github.com/kognise/water.css).
## Building
This is a Maven project that depends on the [Java Microbenchmark Harness](https://openjdk.java.net/projects/code-tools/jmh/).
You can build and package the application as the file *target/benchmarks.jar* with the commands:
```console
$ export JAVA_HOME=$HOME/opt/jdk-14.0.1
$ mvn package
```
## Running
Run a quick test with a command like the following:
```ShellSession
$ java -Djava.library.path=$HOME/lib/javafx-sdk-15/lib \
-jar target/benchmarks.jar -f 1 -i 1 -wi 1
```
Run the benchmarks with their default options for a more thorough test:
```ShellSession
$ java -Djava.library.path=$HOME/lib/javafx-sdk-15/lib \
-jar target/benchmarks.jar
```
The `-h` option prints a description of all benchmark command options:
```ShellSession
$ java -jar target/benchmarks.jar -h
```