Skip to content

Commit

Permalink
Merge pull request #25 from Neuffexx/main
Browse files Browse the repository at this point in the history
Bring Dev up to date
  • Loading branch information
Neuffexx authored Jul 13, 2023
2 parents c99ed6c + 09066af commit 8bef8e4
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 51 deletions.
42 changes: 22 additions & 20 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ jobs:
runs-on: windows-latest
env:
# Release Variables
Release_Title: "DisplayKeys-IS | Previewer | v0.3.0"
Release_Title: "DisplayKeys-IS | Patch | v0.3.1"
Release_Body: ${{ github.workspace }}/ProjectFiles/config/releaselog.md
Tag: "v0.3.0"
Artifact_Title: "DisplayKeys-IS_v0.3.0.exe"
Tag: "v0.3.1"
Artifact_Title: "DisplayKeys-IS_v0.3.1.exe"

# Packaging Command Variables
Application_File_Path: ${{ github.workspace }}/ProjectFiles/DisplayKeys-IS.py
Expand All @@ -37,21 +37,6 @@ jobs:
Packaging_Add_Versioning: ${{ github.workspace }}/ProjectFiles/config/version.txt

steps:
- name: checkout repository
uses: actions/checkout@v3

- name: release
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: false
release_name: $env:Release_Title
tag_name: $env:Tag
body_path: $env:Release_Body
env:
GITHUB_TOKEN: ${{ github.token }}


############## Create Artifact ##############

Expand All @@ -75,6 +60,24 @@ jobs:
with:
name: DisplayKeys-IS
path: ${{ env.Full_Artifact_Save_Path }}


############## Create Release ##############

- name: checkout repository
uses: actions/checkout@v3

- name: release
uses: actions/create-release@v1
id: create_release
with:
draft: false
prerelease: false
release_name: ${{ env.Release_Title }}
tag_name: ${{ env.Tag }}
body_path: ${{ env.Release_Body }}
env:
GITHUB_TOKEN: ${{ github.token }}


############## Upload Artifact ##############
Expand All @@ -92,6 +95,5 @@ jobs:
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ env.Full_Artifact_Save_Path }}
asset_name: $env:Artifact_Title
asset_name: ${{ env.Artifact_Title }}
asset_content_type: application/vnd.microsoft.portable-executable

6 changes: 6 additions & 0 deletions ProjectFiles/DisplayKeys-IS.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Image Splitter made by Neuffexx
## This image splitter was made to allow people to take images they want displayed across their Mountain DisplayPad keys.
## Who asked for this? Me. I did. Because it's a workaround to a problem that shouldn't exist in the first place.
## And I was too lazy to do this to each image manually.
## Was this more effort? Yes. You are welcome.

import os, sys
from PIL import Image, ImageTk, ImageSequence, ImageDraw
import tkinter as tk
Expand Down
16 changes: 7 additions & 9 deletions ProjectFiles/config/releaselog.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
## Previewer Patch + ...
....
## Previewer Patch + UI Colour Change
Just a small quick fix for the Previewer, I noticed that it didnt include special rules for the Outlier Image-Cells like the actual cropping does.
Also changed the colours of the UI to make it more comfortable to use at night/in the dark.


### Changes:
- Fixed the Previewer, now includes logic for Outlier Image-Cells
- Fixed the Previewer
> Note that the previewer is just that, a previewer.
> Its not 100% Accurate at the moment and will not affect the final result.
- Added a bit of colour to the interface, mainly for the sake of my own eyes at late nights of working on it.
- If someone has any suggestions for a good cholour scheme let me know over on discord.
-
-

> Its not 100% Accurate at the moment, and will not affect the final results.
- Changed Colour scheme of UI
- _If someone has any suggestions for a good cholour scheme let me know over on discord. @Neuffexx_
52 changes: 30 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,44 +1,51 @@
# DisplayKeys-IS

## What is it?
Simply said, a quick workaround tool for splitting images, in a way that lets users customize the spacing between the split image cells, to be used with display key pads.
Dont get me wrong, there are PLENTY of image splitting tools out there hosted on websites even, so you dont have to download anything.
But none of them from what I found actually allow you to adjust anything other than Rows/Columns.
Simply said, a quick workaround tool for splitting images, in a way that lets users customize the spacing between the split image cells, to be used with display key pads.
_Should work for any Display Pad, as it currently doesnt interface with any of them directly._

## Why Make it?
Well I needed a way be able to quickly setup images across different Display Keys.
And although the Mountain Everest addition, the Display Pad, does come with functionallity to make use of the whole screen to display a single image continiously.
Well I needed a way be able to quickly setup images across different Display Keys.
Dont get me wrong, there are PLENTY of image splitting tools out there hosted on websites even, so you dont have to download anything.
But none of them from what I found actually allow you to adjust anything other than Rows/Columns.

And although the Mountain Everest addition, the Display Pad, does come with functionallity to make use of the whole screen to display a single image continiously.
It certainly doesnt when you are actually using it, as of the time of writing this (27/6/2023) it only supports this functionality when using a 'lockscreen' image.

## How do you use it?
The only thing anyone probably cares to read on here, so let me make this simple:
- Download / Setup Instructions
- Download the DisplayKeys-IS_vX.X.X file, from the latest of the [Release](https://github.com/Neuffexx/DisplayKeys-IS/releases) page
- Run
> You may get a warning when first launching it, this is a False Positive, just click 'Run Anyway'.
> You may get a warning when first launching it, just click 'Run Anyway'.

> _If you feel uncomfortable to download the .exe your free to go over the single code file that is the Application to ensure its safe (ProjectFiles/DisplayKeys-IS.py).
Or the action that builds & publishes it (.github/workflows/release.yml)_
- Usage Instructions / Or watch the [Usage Demonstration Video](https://youtu.be/D6juk_5pe5Q)
- Select an Image to split, either by entering the path into the text box or selecing it via the 'Browse' button.
- Select the Save Location, again, either by entering the path or selecting it. (defualt save location if none is entered: _Desktop_)
- Select an Image to split, by selecing it via the 'Browse' button.
- Select the Save Location, again, by selecting it. (defualt save location if none is entered: _Desktop_)
- (Optionally) Set Image Splitting Parameters
- Defaults: Will Split the image in a 2x6 grid, using Spacing horizontally and vertically by 40pixels.
- User Defined: Will let you manually enter the amount of Rows/Columns, and both Horizontal and Vertical Spacing.
- (Optionally) Click the 'Update Preview' button to the right to see a preview representation of what is will be split/cut.
- Click the 'Split Image' button.
- In the Base Camp software, when assigning images to your DisplayKeys, find wanted images in your provided Save Location.
- `Defaults:` Will Split the image in a 2x6 grid, using Spacing of **_40 (pixels)_**.
- `User Defined:` Will let you manually enter the amount of Rows/Columns, and the Spacing between Image-Cells.
- (Optionally) Click the `Update Preview` button to the right to see a preview representation of what is will be split/cut.
- Click the `Split Image` button.
- Settings will use defaults for any input not given.
- Just assign them in your DisplayPad Provider's software.
And your done :D

## Whats Next?
Well I plan to add/improve on the following
Well I plan to add/improve on the following (in no particular order):
- Clean Up UI
- Make preview more accurate to final result
- Improve Image Splitting Logic
- Saving/Loading presets aka. profiles (in case you find combos that work for you)
- Automate Profile Assignment ! Base Camp Only ! (Need to look into how)
- Add Grid Offset input, that can be adjusted and seen in the previewer
- Add GIF support for the previewer
- Add Popup Windows in case of an error, required user confirmation, or the notify the user of any action
- Automate Image Assignment to Profiles ! BaseCamp Software ! (Need to look into how)
- Add Saving/Loading presets aka. profiles
(in case you find combos that work for you, ie. for specific resolutions/aspect ratios)
- Add Grid Offset input, that can be seen and adjusted in the Previewer
- Add GIF support, for the Previewer
(Splitting functionality already supports it)
- Add Pop-up Windows in case of an error, required user confirmation, or the notify the user of any action
- Add Drag & Drop support, will let you drag your Image straight into the App if of a supported format

<pre>

Expand All @@ -64,7 +71,7 @@ The app can be split into 2 parts:
- The Graphical User Interface (GUI)
- The Image Splitting Logic

### The GUI `NEEDS UPDATING`
### The GUI (`SECTION NEEDS UPDATING`)
By far the hardest part about this project, for me at least, as I had never done anything like this before.
Its completely built using the [TkInter Library](https://wiki.python.org/moin/TkInter).

Expand Down Expand Up @@ -105,14 +112,15 @@ And although I could statically say, if at Top row then crop at top of image, an
This approach falls appart the moment more than 2 rows are used. *Of course also if less than 2 rows, but the inital implementation of this tool was `not` made with handeling such situations in mind.
As for example, someone may need to add a third row in the splitting process, due to the subject of the image that the user wants to see potentionally only being in the top or bottom 2/3rds of the image.

So I went about it by seperately setting up the cropping for cells that I seperate into 'Outliers' (Orange) and 'Core' (Purple) cells.
So I went about it by seperately setting up the cropping for cells that I seperate into `Outliers` (Orange) and `Core` (Purple) cells.
The logic can be summed up to this:
- Determine which image cells are outlier cells or core cells
- If its an outlier cell, check the longest_dimension to determine whether to crop away only at the sides or top/bottom. But only the one that is facing outwards.
- If its a core cell, check the longest_dimension to determine whether to crop away only at the sides or top/bottom. But either 'both sides' or 'both bottom and top'.

(This image is divided by an extra row / column for demonstration purposes)
![Image showing a 3x8 cell division, highlighting both the outlier and core cells](https://i.imgur.com/zcCL5YL.jpg)
![Image showing a 3x8 cell division, highlighting both the outlier and core cells](https://i.imgur.com/zcCL5YL.jpg)
`Orange = Outlier Cells | Purple = Core Cells`

- For the Outlier's: I simply make sure to crop from the outside inwards if the Image-Cell proportions allow it (relative to the original image).
![Image showing a 3x8 cell division, showing the direction of cropping for outlier cells](https://i.imgur.com/lsvQmNl.png)
Expand Down

0 comments on commit 8bef8e4

Please sign in to comment.