Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 107219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T01:43:11+00:00 2026-05-11T01:43:11+00:00

I am trying to use the boost generic image library to convert CYMK images

  • 0

I am trying to use the boost generic image library to convert CYMK images to RGB.

The following code does not compile

// read cmyk image file cmyk8_image_t img; jpeg_read_image( '1502-T2-C-PER.jpg', img );  // convert to rgb rgb8_image_t rgb( img.dimensions() ); copy_pixels(     color_converted_view<rgb8_image_t>(view(img)),     view(rgb)); 

Anyone know how to fix this?

I have based this code on tutorial code

void x_luminosity_gradient(const rgb32fc_view_t& src, const gray8s_view_t& dst) {     gray8_image_t ccv_image(src.dimensions());     copy_pixels(color_converted_view<gray8_pixel_t>(src), view(ccv_image)); 

Here is the compiler output:

1>c:\program files\boost\boost_1_35_0\boost\gil\step_iterator.hpp(164) : error C2664: 'boost::gil::detail::step_iterator_adaptor<Derived,Iterator,SFn>::step_iterator_adaptor(const Iterator &,SFn)' : cannot convert parameter 1 from 'const boost::gil::dereference_iterator_adaptor<Iterator,DFn>' to 'const boost::gil::rgb8_ptr_t &' 1>        with 1>        [ 1>            Derived=boost::gil::memory_based_step_iterator<boost::gil::rgb8_ptr_t>, 1>            Iterator=boost::gil::rgb8_ptr_t , 1>            SFn=boost::gil::memunit_step_fn<boost::gil::rgb8_ptr_t > 1>        ] 1>        and 1>        [ 1>            Iterator=boost::gil::cmyk8_ptr_t , 1>            DFn=boost::gil::color_convert_deref_fn<const boost::gil::pixel<boost::gil::bits8,boost::gil::cmyk_layout_t> ,boost::gil::rgb8_view_t,boost::gil::default_color_converter> 1>        ] 1>        Reason: cannot convert from 'const boost::gil::dereference_iterator_adaptor<Iterator,DFn>' to 'const boost::gil::rgb8_ptr_t ' 1>        with 1>        [ 1>            Iterator=boost::gil::cmyk8_ptr_t , 1>            DFn=boost::gil::color_convert_deref_fn<const boost::gil::pixel<boost::gil::bits8,boost::gil::cmyk_layout_t> ,boost::gil::rgb8_view_t,boost::gil::default_color_converter> 1>        ] 1>        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called 1>        c:\program files\boost\boost_1_35_0\boost\gil\locator.hpp(271) : see reference to function template instantiation 'boost::gil::memory_based_step_iterator<Iterator>::memory_based_step_iterator<boost::gil::dereference_iterator_adaptor<boost::gil::pixel<ChannelValue,Layout>,DFn>>(const boost::gil::memory_based_step_iterator<boost::gil::dereference_iterator_adaptor<boost::gil::pixel<ChannelValue,Layout>,DFn>> &)' being compiled 1>        with 1>        [ 1>            Iterator=boost::gil::rgb8_ptr_t, 1>            ChannelValue=boost::gil::bits8, 1>            Layout=boost::gil::cmyk_layout_t, 1>            DFn=boost::gil::color_convert_deref_fn<const boost::gil::pixel<boost::gil::bits8,boost::gil::cmyk_layout_t> ,boost::gil::rgb8_view_t,boost::gil::default_color_converter> 1>        ] 1>        c:\program files\boost\boost_1_35_0\boost\gil\image_view.hpp(101) : see reference to function template instantiation 'boost::gil::memory_based_2d_locator<StepIterator>::memory_based_2d_locator<boost::gil::memory_based_step_iterator<Iterator>>(const boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<Iterator>> &)' being compiled 1>        with 1>        [ 1>            StepIterator=boost::gil::memory_based_step_iterator<boost::gil::rgb8_ptr_t>, 1>            Iterator=boost::gil::dereference_iterator_adaptor<boost::gil::cmyk8_ptr_t ,boost::gil::color_convert_deref_fn<const boost::gil::pixel<boost::gil::bits8,boost::gil::cmyk_layout_t> ,boost::gil::rgb8_view_t,boost::gil::default_color_converter>> 1>        ] 1>        c:\documents and settings\james\my documents\code\animag\test\test.cpp(17) : see reference to function template instantiation 'boost::gil::image_view<Loc>::image_view<SrcView>(const View &)' being compiled 1>        with 1>        [ 1>            Loc=boost::gil::rgb8_loc_t, 1>            SrcView=boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::dereference_iterator_adaptor<boost::gil::cmyk8_ptr_t ,boost::gil::color_convert_deref_fn<const boost::gil::pixel<boost::gil::bits8,boost::gil::cmyk_layout_t> ,boost::gil::rgb8_view_t,boost::gil::default_color_converter>>>>>, 1>            View=boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::dereference_iterator_adaptor<boost::gil::cmyk8_ptr_t ,boost::gil::color_convert_deref_fn<const boost::gil::pixel<boost::gil::bits8,boost::gil::cmyk_layout_t> ,boost::gil::rgb8_view_t,boost::gil::default_color_converter>>>>> 1>        ] 1>        c:\documents and settings\james\my documents\code\animag\test\test.cpp(48) : see reference to function template instantiation 'void processRGB<boost::gil::image_view<Loc>>(SrcView &)' being compiled 1>        with 1>        [ 1>            Loc=boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::dereference_iterator_adaptor<boost::gil::cmyk8_ptr_t ,boost::gil::color_convert_deref_fn<const boost::gil::pixel<boost::gil::bits8,boost::gil::cmyk_layout_t> ,boost::gil::rgb8_view_t,boost::gil::default_color_converter>>>>, 1>            SrcView=boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::dereference_iterator_adaptor<boost::gil::cmyk8_ptr_t ,boost::gil::color_convert_deref_fn<const boost::gil::pixel<boost::gil::bits8,boost::gil::cmyk_layout_t> ,boost::gil::rgb8_view_t,boost::gil::default_color_converter>>>>> 1>        ] 1>c:\program files\boost\boost_1_35_0\boost\gil\pixel.hpp(146) : error C2440: '=' : cannot convert from 'const boost::gil::image<Pixel,IsPlanar,Alloc>' to 'boost::gil::bits8' 1>        with 1>        [ 1>            Pixel=boost::gil::rgb8_pixel_t, 1>            IsPlanar=false, 1>            Alloc=std::allocator<unsigned char> 1>        ] 1>        No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called 1>        c:\program files\boost\boost_1_35_0\boost\gil\pixel.hpp(128) : see reference to function template instantiation 'void boost::gil::pixel<ChannelValue,Layout>::assign<P>(const Channel &,boost::mpl::false_)' being compiled 1>        with 1>        [ 1>            ChannelValue=boost::gil::bits8, 1>            Layout=boost::gil::rgb_layout_t, 1>            P=boost::gil::image<boost::gil::rgb8_pixel_t,false,std::allocator<unsigned char>>, 1>            Channel=boost::gil::image<boost::gil::rgb8_pixel_t,false,std::allocator<unsigned char>> 1>        ] 1>        c:\program files\boost\boost_1_35_0\boost\gil\algorithm.hpp(236) : see reference to function template instantiation 'boost::gil::pixel<ChannelValue,Layout> &boost::gil::pixel<ChannelValue,Layout>::operator =<boost::gil::image<Pixel,IsPlanar,Alloc>>(const P &)' being compiled 1>        with 1>        [ 1>            ChannelValue=boost::gil::bits8, 1>            Layout=boost::gil::rgb_layout_t, 1>            Pixel=boost::gil::rgb8_pixel_t, 1>            IsPlanar=false, 1>            Alloc=std::allocator<unsigned char>, 1>            P=boost::gil::image<boost::gil::rgb8_pixel_t,false,std::allocator<unsigned char>> 1>        ] 1>        c:\program files\boost\boost_1_35_0\boost\gil\algorithm.hpp(231) : while compiling class template member function 'void boost::gil::detail::copier_n<I,O>::operator ()(boost::gil::iterator_from_2d<Loc2>,__w64 int,boost::gil::iterator_from_2d<Loc>) const' 1>        with 1>        [ 1>            I=boost::gil::iterator_from_2d<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::dereference_iterator_adaptor<boost::gil::cmyk8c_ptr_t ,boost::gil::color_convert_deref_fn<const boost::gil::pixel<boost::gil::bits8,boost::gil::cmyk_layout_t> ,boost::gil::rgb8_image_t,boost::gil::default_color_converter>>>>>, 1>            O=boost::gil::iterator_from_2d<boost::gil::rgb8_loc_t>, 1>            Loc2=boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::dereference_iterator_adaptor<boost::gil::cmyk8c_ptr_t ,boost::gil::color_convert_deref_fn<const boost::gil::pixel<boost::gil::bits8,boost::gil::cmyk_layout_t> ,boost::gil::rgb8_image_t,boost::gil::default_color_converter>>>>, 1>            Loc=boost::gil::rgb8_loc_t 1>        ] 1>        c:\program files\boost\boost_1_35_0\boost\gil\algorithm.hpp(266) : see reference to class template instantiation 'boost::gil::detail::copier_n<I,O>' being compiled 1>        with 1>        [ 1>            I=boost::gil::iterator_from_2d<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::dereference_iterator_adaptor<boost::gil::cmyk8c_ptr_t ,boost::gil::color_convert_deref_fn<const boost::gil::pixel<boost::gil::bits8,boost::gil::cmyk_layout_t> ,boost::gil::rgb8_image_t,boost::gil::default_color_converter>>>>>, 1>            O=boost::gil::iterator_from_2d<boost::gil::rgb8_loc_t> 1>        ] 1>        c:\program files\boost\boost_1_35_0\boost\gil\algorithm.hpp(292) : see reference to function template instantiation 'DstIterator boost::gil::detail::copy_with_2d_iterators<boost::gil::iterator_from_2d<Loc2>,boost::gil::iterator_from_2d<Loc>>(SrcIterator,SrcIterator,DstIterator)' being compiled 1>        with 1>        [ 1>            DstIterator=boost::gil::iterator_from_2d<boost::gil::rgb8_loc_t>, 1>            Loc2=boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::dereference_iterator_adaptor<boost::gil::cmyk8c_ptr_t ,boost::gil::color_convert_deref_fn<const boost::gil::pixel<boost::gil::bits8,boost::gil::cmyk_layout_t> ,boost::gil::rgb8_image_t,boost::gil::default_color_converter>>>>, 1>            Loc=boost::gil::rgb8_loc_t, 1>            SrcIterator=boost::gil::iterator_from_2d<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::dereference_iterator_adaptor<boost::gil::cmyk8c_ptr_t ,boost::gil::color_convert_deref_fn<const boost::gil::pixel<boost::gil::bits8,boost::gil::cmyk_layout_t> ,boost::gil::rgb8_image_t,boost::gil::default_color_converter>>>>> 1>        ] 1>        c:\documents and settings\james\my documents\code\animag\test\test.cpp(44) : see reference to function template instantiation 'void boost::gil::copy_pixels<boost::gil::image_view<Loc>,boost::gil::image_view<boost::gil::rgb8_loc_t>>(const View1 &,const View2 &)' being compiled 1>        with 1>        [ 1>            Loc=boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::dereference_iterator_adaptor<boost::gil::cmyk8c_ptr_t ,boost::gil::color_convert_deref_fn<const boost::gil::pixel<boost::gil::bits8,boost::gil::cmyk_layout_t> ,boost::gil::rgb8_image_t,boost::gil::default_color_converter>>>>, 1>            View1=boost::gil::image_view<boost::gil::memory_based_2d_locator<boost::gil::memory_based_step_iterator<boost::gil::dereference_iterator_adaptor<boost::gil::cmyk8c_ptr_t ,boost::gil::color_convert_deref_fn<const boost::gil::pixel<boost::gil::bits8,boost::gil::cmyk_layout_t> ,boost::gil::rgb8_image_t,boost::gil::default_color_converter>>>>>, 1>            View2=boost::gil::image_view<boost::gil::rgb8_loc_t> 1>        ] 
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T01:43:11+00:00Added an answer on May 11, 2026 at 1:43 am

    Found the problem

    // read cmyk image file cmyk8_image_t img; jpeg_read_image( '1502-T2-C-PER.jpg', img );  //// convert to rgb rgb8_image_t rgb( img.dimensions() ); copy_pixels(     color_converted_view<rgb8_pixel_t>(view(img)),     view(rgb)); 

    The trick is to use rgb8_pixel_twhen calling color_converted_view

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to use the boost library in my code but get the following
At the following code I am trying to use Boost Spirit Auto Parser for
I am trying to use the timed_wait from boost. Now I am actually not
I am trying to use Boost.Spirit (V. 2.5) library to create a mini-calculator. Features
So, I'm trying to use boost.process library. I downloaded package from this location ,
I'm trying to use boost.signals library. I know that to use it, first I
I am trying to figure out how to use the Boost.Preprocessor library http://www.boost.org/doc/libs/release/libs/preprocessor to
I'm trying to use boost unit testing alongside the Allegro graphics library, but both
I am trying to use BOOST ASIO library asynchronous sockets. My platform is Linux.
I'm trying to use boost::thread but I can't compile because of an error compiling

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.