NOTE FROM DEV: This is the only occasion ever where I will use electron, in my opinion electron is hot trash because it takes up lots of memory, but for occasions like this, it is very useful. Also, this project was inspired by facedev's bruh image file type.
if you don't want to run the command to make the images the yourself, then there is plenty of images you can use in the
examplesfolder
xdrx is a custom image file format where each pixel is represented by a hex color value, with each new line of pixels starting on a new line. It allows you to convert images to the .xdrx format and view them in a draggable window.
Install xdrx globally using npm:
npm install -g xdrxOr with Yarn:
yarn global add xdrxOr with pnpm:
pnpm add -g xdrxTo convert an image to the .xdrx format, you must specify the input file first, followed by the desired output file name:
xdrx convert path/to/input-image.png output-fileThis command will convert input-image.png to output-file.xdrx. Make sure to provide the correct path to the input image and specify the name of the output .xdrx file.
To view an .xdrx file, specify the file name directly:
xdrx view path/to/image.xdrxThis will open a new draggable window displaying the image from the .xdrx file.
To contribute:
- Fork the repo.
- Create a new branch.
- Make your changes.
- Push to your fork.
- Create a Pull Request.
Installing needed packages:
sudo apt install -y libx11-dev libxkbcommon-x11-dev libx11-xcb-dev libxcomposite-dev libxdamage-dev libxrandr-dev libxfixes-dev libxcursor-dev libxtst-dev libnss3 libatk-bridge2.0-dev libgtk-3-dev libasound2-devTo install all of the files normally you would run:
npm install -g xdrx@latest A file that is responsible for opening windows (electron.js) is for some reason is not installed with it.
To install it run this command:
cat <<EOF > electron.js
const { app, BrowserWindow } = require('electron');
const path = require('path');
// Create a new browser window
function createWindow() {
const win = new BrowserWindow({
width: 800,
height: 600,
webPreferences: {
nodeIntegration: true,
},
});
// Load the local server (localhost:3000)
win.loadURL('http://localhost:3000');
// Optional: Open DevTools for debugging
// win.webContents.openDevTools();
}
// Initialize the Electron app
app.whenReady().then(() => {
createWindow();
app.on('activate', () => {
if (BrowserWindow.getAllWindows().length === 0) {
createWindow();
}
});
});
// Quit when all windows are closed (except on macOS)
app.on('window-all-closed', () => {
if (process.platform !== 'darwin') {
app.quit();
}
});
EOFxdrx is licensed under the ISC License.
For questions or issues, open an issue on the GitHub repo.