# Color channel

**URL:** https://discourse.julialang.org/t/color-channel/108714
**Category:** New to Julia
**Tags:** question, images
**Created:** [January 12, 2024, 1:32am UTC](https://discourse.julialang.org/t/color-channel/108714 "2024-01-12T01:32:45Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Afonso\_Britto](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/afonso_britto/32/205972_2.png) [@Afonso\_Britto](https://discourse.julialang.org/u/Afonso_Britto)
#### Post date: [January 12, 2024, 1:32am UTC](https://discourse.julialang.org/t/color-channel/108714/1 "2024-01-12T01:32:45Z")

</div>

I’m learning how to use Julia for image processing. I want to change the values in the color channels. Something like this:

> red.(j[:, i]) .= red.(j[:, i])

But I don’t understand why it does not work.

---

<div class="post-metadata">

### Author: ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)
#### Post date: [January 12, 2024, 9:18am UTC](https://discourse.julialang.org/t/color-channel/108714/2 "2024-01-12T09:18:22Z")

</div>

I’d recommend you read

> [@Please read: make it easier to help you](https://discourse.julialang.org/t/please-read-make-it-easier-to-help-you/14757):
>
> Welcome to the Julia Discourse! We are enthusiastic about helping Julia programmers, both beginner and experienced. This public service announcement (PSA) outlines best practices when asking for help. Following these points makes it easier for us to help you and more likely you’ll get a prompt, useful answer. Keywords are highlighted to make it easier to refer to specific points. Choose a descriptive title that captures the key part of your question, eg “plots with multiple axes” instead of …

and edit your question accordingly to turn it into an MWE so that people can help you more easily.

Without knowin what `red` or `j` is, I’d say your code shouldn’t be valid Julia:

```julia
julia> x = rand(3, 2);

julia> sin.(x[:, 2]) = sin.(x[:, 2])
ERROR: syntax: invalid syntax "sin.(x[:, 2]) = ..." around REPL[34]:1

```

The left hand side of `=` should be something you can assign to, which `red.(j[:, i])` most likely isn’t. Maybe you meant

```julia
j[:, i] .= red.(j[:, i])

```

but again it’s hard to tell without more information.
