Skip to content

Iron-Wolf/PixelComparator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PixelComparator

CodeFactor GitHub last commit Average time to resolve an issue
GitHub code size in bytes GitHub release (latest by date) GitHub license

Detecting the closest color to each pixel of a pre-pixelized image

Installation

Juste grab the latest jar artifact in the release tab, and launch it with java. No fuss.

Contributing

Check these steps to configure the project correctly.
It's also serves as a reminder, for my lazy brain.

Download SDK

Open-jdk is accessible on the official website.
JavaFX is hosted on Gluon.

Compile & Debug

To compile the project with IntelliJ :

  • Check out the project from github
  • Configure the source folder in the Content Root
  • Build (choose one)
    • Maven : Create a Maven configuration with javafx:run (and Build before launch)
    • Application with VM options : -p </path/jafx-sdk>/lib --add-modules javafx.controls,javafx.fxml,javafx.swing
  • Run the configuration

Make sure you have the JDK referenced in the project settings.

JavaFX with Maven

This project is configured with JavaFX as a Maven dependency.
The actual JavaFX situation with Maven is, either :

  • Use the com.zenjava maven plugin with Java 8 or 9
  • Use Java 8 or 9 and don't specify maven dependecy for JavaFX
  • Use the org.openjfx with Java 11+

Source on stackoverflow

Reminder
As of OpenJDK-8/JDK-11, JavaFX is no longer included in the base JDK.
You will need to install the openjfx package.
Or make sure that your JDK contains this file : <Java SDK root>/jre/lib/ext/jfxrt.jar.

Package & Run

With Java 8 or 9, package the application in a simple jar artifact to access it outside of the IDE.

Extra step for Java 11+ :
You will need the JavaFX SDK libraries, corresponding to your platform.
Then, you will be able to launch the app with this command :

java -p javafx-sdk-11.0.2/lib \
--add-modules javafx.controls,javafx.fxml,javafx.swing \
-jar pixel_comparator.jar

IntelliJ Troubleshooting

You might encounter one of this errors with the IntelliJ IDE.

Maven version

Error:java: error: release version 5 not supported

Force target Maven version to the JDK version (default is 1.5, which might not be appropriate for your JDK).
Change the source/target configuration in the POM.
https://stackoverflow.com/a/12900859

JavaFX modules

IllegalAccessError with FXMLLoaderHelper

IntelliJ doesn't load all JavaFX module by default.
Add VM options : https://stackoverflow.com/a/54292408
Or run Maven goal javafx:run

Complete answer : https://stackoverflow.com/a/52470141