Thanks Maarten for the advice. OpenCV loads the image in RGB format but Cairo Loads in PRGB(Pre multiplied with Alpha channele). hence while loading the image, I convert the 3 channel image to 4 channel in OpenCV and then pass the resulting image to Cairo and then I get the perfect result.<br>
<br>Thanks all for the advice. But still I can&#39;t find how can I check for the format of the image as I create the surface from data and its need to have format as parameter.<br><br>Thanks for the advices.<br><br>Deepak<br>
<br><div class="gmail_quote">On Wed, Sep 14, 2011 at 6:18 PM, Maarten Bosmans <span dir="ltr">&lt;<a href="mailto:mkbosmans@gmail.com">mkbosmans@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
2011/9/14 Deepak Kumar JAIN &lt;<a href="mailto:deepak19dec@gmail.com">deepak19dec@gmail.com</a>&gt;:<br>
<div class="im">&gt; Hello All,<br>
&gt;<br>
&gt; When I load the same png image in OpenCV and cairoGraphics, I see that the<br>
&gt; data of the image is not same.<br>
&gt;<br>
&gt;<br>
&gt; <a href="http://postimage.org/image/vlpntz38/" target="_blank">http://postimage.org/image/vlpntz38/</a><br>
&gt;<br>
&gt; Image can be seen here. I see that every 4th data entry in after I get data<br>
&gt; from surface has value of 255. I dont know why.<br>
&gt;<br>
&gt; Can anyone give the explanation of this?<br>
<br>
</div>OpenCV is probably expecting RGB, while cairo is providing ARGB data.<br>
<br>
Try constructing a 24bpp ImageSurface.<br>
<font color="#888888"><br>
Maarten<br>
</font><div class="im"><br>
&gt; Thanks,<br>
&gt; Deepak<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; --<br>
&gt;<br>
&gt; Thanks &amp; Regards,<br>
&gt; Deepak Kumar JAIN<br>
&gt; Internship student,<br>
&gt; Orange Labs,France Telecom,<br>
&gt; Rennes, France<br>
&gt; Contact: <a href="tel:%2B33%280%296%2031%2015%2044%2066" value="+33631154466">+33(0)6 31 15 44 66</a><br>
&gt; <a href="http://www.deepakkumarjain.co.cc" target="_blank">www.deepakkumarjain.co.cc</a><br>
&gt;<br>
&gt; &quot;I err therefore I am &quot;- Saint Augustine<br>
&gt;<br>
&gt;<br>
</div><div><div></div><div class="h5">&gt; --<br>
&gt; cairo mailing list<br>
&gt; <a href="mailto:cairo@cairographics.org">cairo@cairographics.org</a><br>
&gt; <a href="http://lists.cairographics.org/mailman/listinfo/cairo" target="_blank">http://lists.cairographics.org/mailman/listinfo/cairo</a><br>
&gt;<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>
<div><br>Thanks &amp; Regards,<br>Deepak Kumar JAIN<br>Internship student, <br>Orange Labs,France Telecom,<br>Rennes, France<br>Contact: +33(0)6 31 15 44 66<br><a href="http://www.deepakkumarjain.co.cc" target="_blank">www.deepakkumarjain.co.cc</a><br>
</div>
<div><br><font face="Verdana, Arial, Helvetica, sans-serif" color="#000099">&quot;<i style="color:rgb(0, 0, 0)">I err therefore I am </i>&quot;- Saint Augustine</font><br> </div>
<div></div>
<div></div>
<div></div><div style="padding:0px;margin-left:0px;margin-top:0px;overflow:hidden;word-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:130%"></div><div style="padding:0px;margin-left:0px;margin-top:0px;overflow:hidden;word-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:130%">
</div><div style="padding:0px;margin-left:0px;margin-top:0px;overflow:hidden;word-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:130%"></div><div style="padding:0px;margin-left:0px;margin-top:0px;overflow:hidden;word-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:130%">
</div><div style="padding:0px;margin-left:0px;margin-top:0px;overflow:hidden;word-wrap:break-word;color:black;font-size:10px;text-align:left;line-height:130%"></div><br>