Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #39293

Re: Near random colors to picture pixels, so that same color matches same random color.

Subject Re: Near random colors to picture pixels, so that same color matches same random color.
Newsgroups comp.lang.javascript
References <5c0399a6-d083-4269-b25b-5ce92f91ba2an@googlegroups.com> <0fa596ff-6c12-4626-9a39-172f47d91514n@googlegroups.com> <f38b61f2-9490-4175-8880-fdbc26b9cdc9n@googlegroups.com>
From Richard Damon <Richard@Damon-Family.org>
Message-ID <6esEH.15528$EY1.11782@fx42.iad> (permalink)
Organization Forte - www.forteinc.com
Date 2020-12-22 14:58 -0500

Show all headers | View raw


On 12/22/20 12:29 PM, Kristjan Robam wrote:
> Michael Haufe (TNO) kirjutas pühapäev, 15. november 2020 kl 21:07:18 UTC+2:
>> On Sunday, November 15, 2020 at 1:01:01 PM UTC-6, rob9999999...@gmail.com wrote: 
>>> Anyone can point to a place, where to download code for this ? 
>>>
>> I don't know what you mean. Can you give more details?
> What I want to say is the following.
> Function:
> Renewing each picture color.
> New picture colors must satisfy this:
> 1. Each pixel color goes to random.
> 2. Each same color pixel goes to same color, that is defined in point 1.
> 
> Basically what you would need is a reminder of assigned colors of picture pixels.
> 
> 
> 
> Actually I got that one programmed as far as I remember.
> 
> But what I would now need very much is a function, that turns colors to random so,
> that the difference of near colors is the distance of the original colors of points A and B.
> 
> If you can help me with that, I would be very thankful.
> 
> 
> Kristjan Robam
> 

If your requirements are that the 'spacing' between all colors in the
original image and in the new image are preserved, your randomness is
going to be greatly limited. One big question is how you want to define
the distance between colors (largly which color space you want to
measure in). If you presume that the image might be using a broad
assortment of colors and distance measured but RGB distance, then the
only general transformations that preserve distances would be swapping
axis and reversing the direction of some of the axis.

Some other spaces might give slightly different options, but similar, as
'Hue' based color spaces have a polar axis which behaves a bit
differently than a cartisian axis so can't really swap with another
axis, but can have an arbitrary offset or can be flipped (so gives more
options).

Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Near random colors to picture pixels, so that same color matches same random color. K R <rob99999999999999999@gmail.com> - 2020-11-15 11:00 -0800
  Re: Near random colors to picture pixels, so that same color matches same random color. "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-11-15 11:07 -0800
    Re: Near random colors to picture pixels, so that same color matches same random color. Kristjan Robam <jippii1291983@gmail.com> - 2020-12-22 09:29 -0800
      Re: Near random colors to picture pixels, so that same color matches same random color. "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-12-22 11:35 -0800
      Re: Near random colors to picture pixels, so that same color matches same random color. Richard Damon <Richard@Damon-Family.org> - 2020-12-22 14:58 -0500
        Re: Near random colors to picture pixels, so that same color matches same random color. Kristjan Robam <jippii1291983@gmail.com> - 2020-12-23 11:15 -0800
          Re: Near random colors to picture pixels, so that same color matches same random color. Kristjan Robam <jippii1291983@gmail.com> - 2020-12-23 11:17 -0800
          Re: Near random colors to picture pixels, so that same color matches same random color. Richard Damon <Richard@Damon-Family.org> - 2020-12-23 15:23 -0500
            Re: Near random colors to picture pixels, so that same color matches same random color. Kristjan Robam <jippii1291983@gmail.com> - 2020-12-24 01:10 -0800
              Re: Near random colors to picture pixels, so that same color matches same random color. Kristjan Robam <jippii1291983@gmail.com> - 2020-12-24 01:11 -0800
                Re: Near random colors to picture pixels, so that same color matches same random color. Kristjan Robam <iiiiiiiiiiiia@bestmail.us> - 2020-12-24 04:49 -0800
                Re: Near random colors to picture pixels, so that same color matches same random color. Kristjan Robam <iiiiiiiiiiiia@bestmail.us> - 2020-12-24 05:46 -0800
                Re: Near random colors to picture pixels, so that same color matches same random color. Kristjan Robam <jippii1291983@gmail.com> - 2020-12-24 10:53 -0800
                Re: Near random colors to picture pixels, so that same color matches same random color. "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-12-25 09:33 -0800
                Re: Near random colors to picture pixels, so that same color matches same random color. Kristjan Robam <iiiiiiiiiiiia@bestmail.us> - 2020-12-25 23:17 -0800
                Re: Near random colors to picture pixels, so that same color matches same random color. Kristjan Robam <iiiiiiiiiiiia@bestmail.us> - 2020-12-25 23:18 -0800
                Re: Near random colors to picture pixels, so that same color matches same random color. Kristjan Robam <iiiiiiiiiiiia@bestmail.us> - 2020-12-25 23:33 -0800
                Re: Near random colors to picture pixels, so that same color matches same random color. "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2020-12-26 08:30 -0800
                Re: Near random colors to picture pixels, so that same color matches same random color. Kristjan Robam <jippii1291983@gmail.com> - 2020-12-27 07:57 -0800
                If somebody reads this again ..... I A <he12457@hotmail.com> - 2021-02-14 09:24 -0800
                Re: If somebody reads this again ..... "Michael Haufe (TNO)" <tno@thenewobjective.com> - 2021-02-15 05:55 -0800
                Re: If somebody reads this again ..... Minai Robam <mi23523523@fastmail.com> - 2021-03-30 09:02 -0700
                Re: If somebody reads this again ..... Minai Robam <mi23523523@fastmail.com> - 2021-03-30 09:37 -0700
                Re: If somebody reads this again ..... Minai Robam <mi23523523@fastmail.com> - 2021-03-30 09:39 -0700
        Re: Near random colors to picture pixels, so that same color matches same random color. Kristjan Robam <jippii1291983@gmail.com> - 2020-12-23 11:24 -0800
        Re: Near random colors to picture pixels, so that same color matches same random color. Kristjan Robam <jippii1291983@gmail.com> - 2020-12-23 11:27 -0800
        Re: Near random colors to picture pixels, so that same color matches same random color. Kristjan Robam <jippii1291983@gmail.com> - 2020-12-23 11:30 -0800

csiph-web