Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length

 
Advanced search

1386997 Posts in 66501 Topics- by 59051 Members - Latest Member: Strongfinger

January 17, 2021, 07:55:27 PM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperArtWorkshopJoshua's Art Improvement Thread
Pages: 1 ... 4 5 [6] 7
Print
Author Topic: Joshua's Art Improvement Thread  (Read 48968 times)
Geti
Level 10
*****



View Profile WWW
« Reply #100 on: August 27, 2014, 02:23:05 AM »

Yup, looks like slices through a voronoi volume - he said nearest neighbour and I assume that means in colour space, so basically as you go through the colour cube you find the closest colour that's in your palette, and set  that for the current RGB val (-> giving you a voronoi volume as the end result) - of course, you can most likely just apply the palette to the unrolled RGB cube directly and save unpacking it Wink Seems like the kind of thing that could be done "easily enough" with a .bat/.sh file and imagemagick tbh (colour map in, processed LUT out)
Logged

JobLeonard
Level 10
*****



View Profile
« Reply #101 on: August 27, 2014, 03:05:38 AM »

I was thinking you might make use of the input-image to calibrate the LUT:

- for each colour, count number of pixels using it
- create colour density map based on above (in a 3D volume I suppose, one axis for each colour channel)
- use N weighted Voronoi cells (where N is number of desired colours) to divide this colour space
- use Lloyd's algorithm to reach a point of equilibrium
- take the (weighted?) average of the colours captured by each cell to generate the final palette.

(see also this technique to generate stippled images using weighted centroidal Voronoi diagrams)

But then again, when designing a game you probably want a fixed palette across all sprites and backgrounds used in one scene, not a unique palette per sprite/background element.
Logged
Joshua
Level 5
*****


Be rad to one another!


View Profile WWW
« Reply #102 on: August 27, 2014, 07:17:41 AM »

The voronoi pattern is just a cool artifact.  Wink

Geti is absolutely correct. I'm mapping a function across a three dimensional array representing an identity color space. The problem I'm trying to solve is given a known fixed size color palette, create a function (the LUT) to map 32/64 bit's worth of color values down to the size of the fixed palette. It sounds like you are taking a given image and color reducing it down to a fixed size palette, which is a slightly different problem. I'd be interested in other algorithms for matching two colors. Nearest neighbor is a simple approach.

My original implementation was a Python script, which I hacked out in an evening. I'm rewriting it in C++ as a little command line tool. Hopefully it's easier for folks to use this way. I'm totally open to suggestions.
Logged

Geti
Level 10
*****



View Profile WWW
« Reply #103 on: August 28, 2014, 05:51:35 AM »

As i said, imagemagick is already a thing :^) I'll see what sort of results it gives on a minimised lut now actually
Logged

Geti
Level 10
*****



View Profile WWW
« Reply #104 on: August 28, 2014, 06:03:39 AM »

works, heres arnes 64 v7

http://grab.by/zRS4

Code:
::bat file :^) wouldn't need the "call" in sh, convert should be there if imagemagick is installed
call convert your_colour_map.png -dither None -remap ./any_indexed.png output.png
Logged

Joshua
Level 5
*****


Be rad to one another!


View Profile WWW
« Reply #105 on: September 16, 2014, 05:22:07 PM »


Demo: Painting and mixing colors of similar hue.

Download: Sample Photoshop File + Binary (Win/OSX)
Source: lutr on GitHub

Finally got this to a point where I feel okay sharing it. I've provided the Photoshop and the binary for Windows and Mac for those who want to take it for a test drive. It is a simple command line utility that will convert a .PNG, .ACT, or .PAL (Jasc format) to a .CUBE file. This file can be used in Photoshop to simulate indexed color.

@Geti
Maybe I'm not understanding your approach? For my output I need a three dimensional array, not an image. ImageMagick seems interesting though...
Logged

Aiden Rose (Canned Turkey/CTgames)
Professional Otter
Level 10
*****


WokePosting™


View Profile WWW
« Reply #106 on: September 23, 2014, 02:14:29 PM »

How I wish I could afford photoshop...
Logged

Geti
Level 10
*****



View Profile WWW
« Reply #107 on: September 23, 2014, 10:38:17 PM »

I swear I posted some reply to this earlier but must have been during some downtime or something.

re: LUT needs to be 3d - it doesn't, though, you just need a bit of extra maths to turn r,g,b into x,y

for the full size table:
x = (b%16)*256 + r;
y = (b/16)*256 + g;

for a smaller table with lerp or similar, divide, all of rgb(8,8,8) fits into a 4096 though.
Logged

Joshua
Level 5
*****


Be rad to one another!


View Profile WWW
« Reply #108 on: September 24, 2014, 04:56:57 PM »

@geti
I should clarify, for the lut to work with the Photoshop technique above it needs to be in either .CUBE, .3DL, .3DLS, .1DLS, .LOOK, or .CSP file format. I follow what you are saying, it's just that photoshop isn't as clever.  Wink

@Canned Turkey
Don't fret. Fancy tools are great and all, but in the end don't make a good artist.

Here is some pixel art I've done over that past few weeks for @Pixel_Dailies:





« Last Edit: September 24, 2014, 05:13:07 PM by Joshua » Logged

Geti
Level 10
*****



View Profile WWW
« Reply #109 on: September 24, 2014, 06:50:32 PM »

@geti
I should clarify, for the lut to work with the Photoshop technique above it needs to be in either .CUBE, .3DL, .3DLS, .1DLS, .LOOK, or .CSP file format. I follow what you are saying, it's just that photoshop isn't as clever.  Wink
Oh, that makes more sense, and is a bummer. Will hopefully have some time to actually try it out soon, swamped at the moment Sad

Seen that big koopa thing before, I think; fun shapes. The others are nice too Smiley
Logged

Geti
Level 10
*****



View Profile WWW
« Reply #110 on: December 18, 2014, 09:28:15 PM »

Just FYI the windows version doesn't work without additional dlls. You could fix this by statically linking against the standard lib or including the necessary dlls or redistributable installers alongside.

---------------------------
lutr.exe - System Error
---------------------------
The program can't start because MSVCP120.dll is missing from your computer. Try reinstalling the program to fix this problem.
---------------------------
OK   
---------------------------
Logged

Joshua
Level 5
*****


Be rad to one another!


View Profile WWW
« Reply #111 on: December 19, 2014, 09:55:33 AM »

The Microsoft Visual C++ Redistributable Packages for Visual Studio 2013 are required (noted on the lutr install section).

I'm pretty sure I can't statically link against it, so it is just something that needs to be installed for it to run. I could recompile under MinGW or Cygwin to remove this dependency.

I'm just happy someone tried to use my little tool.  Smiley
Logged

JWK5
Guest
« Reply #112 on: December 19, 2014, 01:54:17 PM »


In GIMP (which is free) you can accomplish the same thing (an "area picker" essentially). Here's how:

Logged
Joshua
Level 5
*****


Be rad to one another!


View Profile WWW
« Reply #113 on: December 19, 2014, 02:03:10 PM »

Photoshop also has a built-in area picker. I'm not sure what you are getting at?
Logged

JWK5
Guest
« Reply #114 on: December 19, 2014, 02:07:38 PM »

It was just a side note for people without Photoshop.
Logged
Joshua
Level 5
*****


Be rad to one another!


View Profile WWW
« Reply #115 on: December 19, 2014, 02:11:21 PM »

 Smiley Hand Thumbs Up Right
Logged

Geti
Level 10
*****



View Profile WWW
« Reply #116 on: December 19, 2014, 10:24:56 PM »

The Microsoft Visual C++ Redistributable Packages for Visual Studio 2013 are required (noted on the lutr install section).

I'm pretty sure I can't statically link against it, so it is just something that needs to be installed for it to run. I could recompile under MinGW or Cygwin to remove this dependency.

I'm just happy someone tried to use my little tool.  Smiley




Fun stuff, got it working with arne's 64
Logged

JobLeonard
Level 10
*****



View Profile
« Reply #117 on: December 20, 2014, 12:27:03 AM »

Here's how:
OH NO, the shitty Buzzfeed-style headline writing has become so all-encompassing it is infecting people's general vernacular! NOOOOOOOOOOOO!!!
Logged
ANtY
Level 10
*****


i accidentally did that on purpose


View Profile WWW
« Reply #118 on: December 20, 2014, 09:21:37 AM »

How I wish I could afford photoshop...
it's only 12€ a month
Logged

Aiden Rose (Canned Turkey/CTgames)
Professional Otter
Level 10
*****


WokePosting™


View Profile WWW
« Reply #119 on: December 20, 2014, 10:13:16 AM »

How I wish I could afford photoshop...
it's only 12€ a month

12€ is 15$, and I don't have a job, or any other way to get that every month. all my money is savings from odd jobs and holidays.
Logged

Pages: 1 ... 4 5 [6] 7
Print
Jump to:  

Theme orange-lt created by panic