To share my recently gained knowledge I've created this question.

Initially it wasn't related to any programming language as this issue concerns color space algorithms in general. After some explanation given me by the moderator who put the question on hold, I've decided to put it in a specific programming context in which I've encountered this issue and vote for reopening.

According to this document this question was initially on-topic, and now is even more (although I feel that putting in the C# context made it loose generality unnecessarily), because:

  • it is about "a software algorithm"
  • it is "practical, answerable problems that are unique to software development"

I think that the first point doesn't need an explanation. The question is about an algorithm, and the answer is an algorithm. The second point: this question is practical because:

1) I've encountered it in a practical context, creating a color classifier :)

2) colour conversions and manipulations are practical concerns existing in large part of software related to graphics or pattern recognition.

Also, this problem is "unique to software development" as the fact that the number of colours is finite in this context is a direct consequence of developing a software on a computer.

What do you think about this?

If you agree, what can I do to have this question reopened?

If not, could you please explain why is it off-topic in the context of the on-topic definition from the Help Center I've referred to?

EDIT: this is another example of the fact, that relations between RGB and LAB spaces are not that uncommon in the programming context: https://stackoverflow.com/search?q=lab+rgb

  • 1
    Your question is about converting RGB into the Lab color space and as such is not actually related to programming per se. Mathematics might be a better choice. – Frédéric Hamidi Oct 5 '13 at 14:02
  • But in mathematics the conversion is straightforward, and LAB is simply unbounded. It is the programming context which makes this answer different than in mathematical context... – BartoszKP Oct 5 '13 at 14:04
  • 1
    I am agree with Minitech your question is better suited for Math.SE – NullPoiиteя Oct 5 '13 at 14:06
  • @NullPoiиteя OK, but shouldn't this mean that all the questions that I've linked in my edit should be closed and moved to Math.SE? – BartoszKP Oct 5 '13 at 14:10
  • @BartoszKP, you seem to be worrying about a and b not being clamped to a particular range, so you cannot scale them. Lab does not work that way, and in the example in your question lab.A and lab.B should already be of double type. I'm afraid you will have to elaborate more on the scaling operation you want to perform on these Lab coordinates for your question to be reopened. – Frédéric Hamidi Oct 5 '13 at 14:13
  • 3
    @FrédéricHamidi as I understand it, the question is about the possible range for A and B so that coefficents can be found to scale the range to [0..255] or [-128..127], because double takes a lot of space to store – John Dvorak Oct 5 '13 at 14:16
  • 1
    @FrédéricHamidi Well yes, they are of type double. I'd like to have them scaled to the [0, 1] interval, exactly as RGB values in my example. The normalization is easy once you know the range. It is unclear what to use for a and b as their maximum values - double.MaxValue would result in a big loss of information. However since it is not obvious, I'll try to improve my question. – BartoszKP Oct 5 '13 at 14:19
  • 3
    I don't see the question as completely off topic (for all the reasons explained in this Meta question). Sure, it might be more suitable for Maths.SE than SO, but since it's not completely off topic, the closure feels a bit hasty. – yannis Oct 5 '13 at 14:20
  • @Jan, true, but IMHO this problem is not actually related to programming even though it deals with powers of two. Scaling values is not specific to programming. – Frédéric Hamidi Oct 5 '13 at 14:21
  • 7
    @FrédéricHamidi Not sure if I understand your point. Many things that algorithms do are not specific to programming. Calculating the value of pi is not specific to programming, yet question concerning it is very highly upvoted. Whole bunch of computer programs that deal with architectural design, drawing, etc. are totally devoted to solve problems not specific to programming. The whole purpose of programming is to make things not related to programming easier. If we were to write programs just to solve problems related to writing programs than it would be a hobby and nothing more :) – BartoszKP Oct 5 '13 at 14:28
  • 1
    @BartoszKP, okay, from that angle you have a point :) I would then second Yannis' comment: I do believe the good folks on Mathematics would provide better answers faster than us on Stack Overflow when things come to Lab space domain and coordinate scaling. Then again, I may be wrong, and time will tell. – Frédéric Hamidi Oct 5 '13 at 14:36
  • Thank you all for your input, equally supporters and critics! I'm very happy that the question was eventually reopened, and I hope that it will be valuable :) – BartoszKP Oct 6 '13 at 0:32

You must log in to answer this question.

Browse other questions tagged .