<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>I think one of us is on the wrong track with what is to be
achieved.<br>
<br>
I don't want to manipulate the image itself, just the background
at the moment when the raster image (or raster pdf) is converted
to a TIF and georeferenced.<br>
<br>
if the rectangle contains black text, as described, this would
also be manipulated after the described manipulation, that's not
what I want.<br>
<br>
Thank you for your efforts.</p>
<p><br>
</p>
<div class="moz-cite-prefix">Am 01.10.2021 um 10:49 schrieb Charles
Dixon-Paver:<br>
</div>
<blockquote type="cite"
cite="mid:CAK2KqidSq8evbmCZr96eX1rRNMGYe++sW6i3z4ojnuA+WQAuQQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">You can translate pixel values with the raster
calculator (available under the raster menu). Black pixels will
have a value of 0,0,0 on RGB bands and red pixels would have a
value of 255,0,0 so it's just a matter of changing the values
accordingly on those bands.
<div><br>
</div>
<div>The raster calculator will contain an if expression in the
next QGIS release, but if you're using an existing release you
will have to use a bit of a quirky syntax to achieve that.</div>
<div><br>
</div>
<div>So if you select the red band and use an expression similar
to <font face="monospace">( "Image@1" = 0 ) * 255</font> it
should work. If you need assistance on raster calculator
syntax gis stack overflow has a large number of Q&A on the
topic.</div>
<div><br>
</div>
<div>If you need info on a particular pixel value at each band,
just use the identify features tool (it works on rasters too).</div>
<div><br>
</div>
<div>Note that the previous statement about the GIS identifying
valid data values from background pixel values still applies
to the calculator.</div>
<div><br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Fri, 1 Oct 2021 at 10:36,
L.W. <<a href="mailto:eaglelw@gmx.de"
moz-do-not-send="true">eaglelw@gmx.de</a>> wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px
0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<p>Thanks for answering, but I think this is not the way I
want to go ...</p>
<p>Or, I do not have written detailed.<br>
</p>
<p>I have a raster image e.g. a white rectangle, after
setting the points, QGIS rotats this image, let's say, by
45 degrees.</p>
<p>The corners of the imported image are now black
triangles.</p>
<p>I do want to have e.g. red triangles ...</p>
<p>Regards<br>
</p>
<p><br>
</p>
<div>Am 01.10.2021 um 09:50 schrieb Charles Dixon-Paver:<br>
</div>
<blockquote type="cite">
<div dir="ltr">There's not really any way for a GIS system
to automatically differentiate between black background
pixels and black data pixels. QGIS supports users
setting custom pixel values to render as transparent
pixels, but it's left up to users to ensure that their
data and background values are different.<br>
<br>
From my view, there are a couple of options when it
comes to fixing this issue in your data. One is to use
an image processing tool like GIMP or Photoshop
effectively, but that requires retaining the geographic
information and knowing how to reprocess the raster
accordingly.<br>
<br>
The simplest solution I'm aware of is probably to follow
this workflow in QGIS:<br>
<ul>
<li>Start a new QGIS project</li>
<li>Set all black pixels to transparent in the
transparency tab of the raster layer properties</li>
<li>Digitize a "bounding area" - you can do this with
a memory layer</li>
<li>Move your vector layer to render underneath the
raster</li>
<li>Give the vector a simple black symbology</li>
<li>Use the "Convert map to raster" tool from the
processing toolbox</li>
</ul>
<div>There are a wide number of variations on that
workflow that are possible of course, but I think
that's the easiest to get started.<br>
<div><br>
</div>
<div>Regards</div>
<div><br>
</div>
</div>
</div>
<div dir="ltr"><br>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Fri, 1 Oct 2021 at
09:28, L.W. <<a href="mailto:eaglelw@gmx.de"
target="_blank" moz-do-not-send="true">eaglelw@gmx.de</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px
0px 0.8ex;border-left:1px solid
rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
how to change the backgroundcolor of a georeferenzed
raster image?<br>
<br>
When a raster image is rotated by qgis after setting
all points the<br>
backgroundcolor is black RGB(0,0,0).<br>
<br>
Set black to transparent is difficult when there is
black text.<br>
<br>
regards<br>
<br>
_______________________________________________<br>
Qgis-user mailing list<br>
<a href="mailto:Qgis-user@lists.osgeo.org"
target="_blank" moz-do-not-send="true">Qgis-user@lists.osgeo.org</a><br>
List info: <a
href="https://lists.osgeo.org/mailman/listinfo/qgis-user"
rel="noreferrer" target="_blank"
moz-do-not-send="true">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
Unsubscribe: <a
href="https://lists.osgeo.org/mailman/listinfo/qgis-user"
rel="noreferrer" target="_blank"
moz-do-not-send="true">https://lists.osgeo.org/mailman/listinfo/qgis-user</a><br>
</blockquote>
</div>
</blockquote>
</div>
</blockquote>
</div>
</blockquote>
</body>
</html>