<div id="__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: #000000;text-align: left" dir="ltr">
                                        Hi Karl --<div><br></div><div>> <span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">It seems to be this that causes the problem when depth is 32 bits.</span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px"><br></span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">Yes, 32-bit depth forms are not meant to have a color map. See class comment in ColorForm.</span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px"><br></span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">> </span><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">This doIt will cause same problem from a workspace:</span></div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">> (1 to: (1 bitShift:32)) collect:[:i | i = 100]</span><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px"><br></span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">Because it will try to allocate about 35 GiB of memory. See my previous answer.</span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px"><br></span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">> </span><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">We should not use this for bit depth > 16 as it will cause problems</span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px"><br></span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">Maybe we should move the algorithm #</span><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">copyWithColorsReducedTo: from Form (32-bit depth) down to ColorForm (up to 16-bit depth).</span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px"><br></span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">Best,</span></div><div><span style="font-family: Arial, Helvetica, sans-serif;font-size: 13px">Marcel</span></div><div class="mb_sig"></div>
                                        <blockquote class="history_container" type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
                        <p style="color: #AAAAAA; margin-top: 10px;">Am 29.06.2022 20:19:06 schrieb karl ramberg <karlramberg@gmail.com>:</p><div style="font-family:Arial,Helvetica,sans-serif">
<div dir="ltr"><div>Hi,</div><div>It seems to be this that causes the problem when depth is 32 bits.<br></div><div><br></div><div>
Form >> #<span style="font-family: Arial,Helvetica,sans-serif;font-size: 13px">copyWithColorsReducedTo:</span>

</div><div>...<br></div><div>colorMap := (1 to: (1 bitShift: depth)) collect:</div><div>....<br></div><div><br></div><div>This doIt will cause same problem from a workspace:<br></div>(1 to: (1 bitShift:32)) collect:[:i | i = 100]<div><br></div><div>We should not use this for bit depth > 16 as it will cause problems</div><div><br></div><div><br></div><div>Best,</div><div>Karl<br></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Jun 29, 2022 at 2:40 PM Marcel Taeumel <<a href="mailto:marcel.taeumel@hpi.de">marcel.taeumel@hpi.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;min-width: 500px"><div id="gmail-m_1896972320177566805__MailbirdStyleContent" style="font-size: 10pt;font-family: Arial;color: rgb(0,0,0);text-align: left" dir="ltr">
                                        Hi Karl --<div></div>
                                        <div><br></div><div>In a 64-bit image, that algorithm tries to allocate about 35 GiB of memory. CMD+Dot will not work because we are sitting in a primitive during that allocation.</div><div><br></div><div>I think that Form >> #<span style="font-family: Arial,Helvetica,sans-serif;font-size: 13px">copyWithColorsReducedTo: was originally (2001) used to reduce colors in 16-bit forms or maybe 8-bit forms, given a 32-bit image.</span></div><div><span style="font-family: Arial,Helvetica,sans-serif;font-size: 13px"><br></span></div><div><div><span style="font-family:Arial,Helvetica,sans-serif"><span style="font-size: 13px">(1 << 32) * 8. "34 359 738 368 bytes"</span></span></div><div><span style="font-family:Arial,Helvetica,sans-serif"><span style="font-size: 13px">(1 << 32) * 4. "17 179 869 184 bytes"</span></span></div></div><div><span style="font-family: Arial,Helvetica,sans-serif;font-size: 13px">(1 << 16) * 4. "262 144 bytes"</span></div><div><span style="font-family: Arial,Helvetica,sans-serif;font-size: 13px">(1 << 8 )* 4. "1024 bytes"</span></div><div><br></div><div>We cannot #collect: this:</div><div><br></div><div>(1 to: 1 << 32) collect: [:ea | ...].</div><div><br></div><div>:-)</div><div><br></div><div>In #<span style="font-family: Arial,Helvetica,sans-serif;font-size: 13px">copyWithColorsReducedTo: it looks like that we expect a color map. In 32-bit forms, there is no color map. Maybe we should move this algorithm down to ColorForm? See its class comment.</span></div><div><br></div><div>Best,</div><div>Marcel</div><blockquote type="cite" style="border-left-style: solid;border-width: 1px;margin-top: 20px;margin-left: 0px;padding-left: 10px;min-width: 500px">
                        <p style="color:rgb(170,170,170);margin-top:10px">Am 28.06.2022 22:49:43 schrieb karl ramberg <<a href="mailto:karlramberg@gmail.com" target="_blank">karlramberg@gmail.com</a>>:</p><div style="font-family:Arial,Helvetica,sans-serif">
<div dir="ltr"><div>Hi,</div><div><br></div><div>If I do Form>>copyWithColorsReducedTo:256 on any form the image stops responding.</div><div>No debug log. <br></div><div><br></div><div>This is on a updated Trunk image. <br></div><div>I'm on a Windows machine.</div><div><br></div><div>Best,</div><div>Karl</div><div><br></div><div><br></div><div><br></div></div>
</div></blockquote></div><br>
</blockquote></div>
</div></blockquote></div>